Refactor keyrelay specs

This commit is contained in:
Martin Lensment 2015-01-26 16:08:25 +02:00
parent 418695ccc7
commit bfb8670233
3 changed files with 154 additions and 140 deletions

View file

@ -31,13 +31,11 @@ RSpec.configure do |config|
# instead of true.
config.use_transactional_fixtures = false
config.before(:suite) do
config.before(:all) do
ActiveRecord::Base.establish_connection :api_log_test
DatabaseCleaner.strategy = :deletion
DatabaseCleaner.clean
ActiveRecord::Base.establish_connection :test
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean
end
config.before(:each) do
@ -48,6 +46,22 @@ RSpec.configure do |config|
DatabaseCleaner.strategy = :truncation
end
config.before(:all, epp: true) do
ActiveRecord::Base.establish_connection :api_log_test
DatabaseCleaner.clean
ActiveRecord::Base.establish_connection :test
DatabaseCleaner.clean
end
config.after(:all, epp: true) do
ActiveRecord::Base.establish_connection :api_log_test
DatabaseCleaner.clean
ActiveRecord::Base.establish_connection :test
DatabaseCleaner.clean
end
config.before(:each, js: true) do
DatabaseCleaner.strategy = :truncation
end