diff options
| author | Luc Donnet | 2015-02-13 08:36:50 +0100 |
|---|---|---|
| committer | Luc Donnet | 2015-02-13 08:36:50 +0100 |
| commit | 10b927934ff86a3461514a376884018d895e6ad6 (patch) | |
| tree | d91e32af89ac95ca46fe0e18a538591641baf047 /spec/support/referential.rb | |
| parent | d71986b6a466f38183e97cf8a3dc460178e4592c (diff) | |
| download | chouette-core-10b927934ff86a3461514a376884018d895e6ad6.tar.bz2 | |
Fix spec with databasecleaner and apartment
Diffstat (limited to 'spec/support/referential.rb')
| -rw-r--r-- | spec/support/referential.rb | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/spec/support/referential.rb b/spec/support/referential.rb index 0cfc3601e..b2a8cf279 100644 --- a/spec/support/referential.rb +++ b/spec/support/referential.rb @@ -29,8 +29,6 @@ RSpec.configure do |config| config.before(:suite) do # Clean all tables to start DatabaseCleaner.clean_with :truncation - # Use transactions for tests - DatabaseCleaner.strategy = :transaction # Truncating doesn't drop schemas, ensure we're clean here, first *may not* exist Apartment::Tenant.drop('first') rescue nil # Create the default tenant for our tests @@ -39,18 +37,17 @@ RSpec.configure do |config| end config.before(:each) do - # Start transaction for this test - DatabaseCleaner.start + DatabaseCleaner.strategy = :transaction # Switch into the default tenant first_referential.switch end config.before(:each, :js => true) do DatabaseCleaner.strategy = :truncation - # Start transaction for this test + end + + config.before(:each) do DatabaseCleaner.start - # Switch into the default tenant - first_referential.switch end config.after(:each) do |
