Merge pull request #1246 from Ana06/db_cleaning
Improvements in the DatabaseCleaner
This commit is contained in:
commit
4a75546e6c
2 changed files with 2 additions and 16 deletions
|
|
@ -55,13 +55,6 @@ RSpec.configure do |config|
|
||||||
# --seed 1234
|
# --seed 1234
|
||||||
config.order = 'random'
|
config.order = 'random'
|
||||||
|
|
||||||
config.around(:each) do |example|
|
|
||||||
DatabaseCleaner.cleaning do
|
|
||||||
Rails.application.load_seed
|
|
||||||
example.run
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# poltergeist as a underlying mech for Capybara
|
# poltergeist as a underlying mech for Capybara
|
||||||
Capybara.javascript_driver = :poltergeist
|
Capybara.javascript_driver = :poltergeist
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,6 @@
|
||||||
RSpec.configure do |config|
|
RSpec.configure do |config|
|
||||||
config.before(:suite) do
|
|
||||||
DatabaseCleaner.clean_with(:truncation)
|
|
||||||
end
|
|
||||||
|
|
||||||
config.before(:each) do
|
config.before(:each) do
|
||||||
DatabaseCleaner.strategy = :transaction
|
DatabaseCleaner.clean_with(:truncation)
|
||||||
end
|
Rails.application.load_seed
|
||||||
|
|
||||||
config.before(:each, js: true) do
|
|
||||||
DatabaseCleaner.strategy = :truncation
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue