Permalink
Browse files

Use truncation database cleaner strategy for js tests

  • Loading branch information...
1 parent a039dad commit 283242f69d931b91b1ee823937d550e38ae2b35b @radar radar committed Feb 22, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 spec/spec_helper.rb
View
@@ -19,9 +19,12 @@
config.include Devise::TestHelpers, :type => :controller
- config.before(:suite) do
- DatabaseCleaner.strategy = :transaction
- DatabaseCleaner.clean_with(:truncation)
+ config.before(:each) do
+ if example.metadata[:js]
+ DatabaseCleaner.strategy = :truncation
+ else
+ DatabaseCleaner.strategy = :transaction
+ end
end
config.before(:each) do

0 comments on commit 283242f

Please sign in to comment.