Skip to content

Commit

Permalink
only use truncation database cleaner strat if in a javascript test
Browse files Browse the repository at this point in the history
  • Loading branch information
radar committed Nov 23, 2011
1 parent 939f066 commit 7b8f26b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@
# instead of true.
config.use_transactional_fixtures = false

config.before(:suite) do
DatabaseCleaner.strategy = :truncation, { :except => ['spree_countries', 'spree_zone_members', 'spree_states', 'spree_roles'] }
config.before(:each) do
if example.metadata[:js]
DatabaseCleaner.strategy = :truncation, { :except => ['spree_countries', 'spree_zone_members', 'spree_states', 'spree_roles'] }
else
DatabaseCleaner.strategy = :transaction
end
end

config.before(:each) do
Expand Down

0 comments on commit 7b8f26b

Please sign in to comment.