mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:57:40 +08:00
disable observers in tests, enable as needed, tests are 20% faster
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user