disable observers in tests, enable as needed, tests are 20% faster

This commit is contained in:
Sam
2013-05-14 11:59:55 +10:00
parent fff46cf5aa
commit ef98b60184
11 changed files with 95 additions and 60 deletions

View File

@ -48,6 +48,8 @@ Spork.prefork do
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
# let's not run seed_fu every test
SeedFu.seed
@ -71,6 +73,11 @@ Spork.prefork do
# config.before(:suite) do
# end
config.before do
# disable all observers, enable as needed during specs
ActiveRecord::Base.observers.disable :all
end
config.before(:all) do
DiscoursePluginRegistry.clear
end