Skip to content
This repository has been archived by the owner on Nov 1, 2017. It is now read-only.

Commit

Permalink
Use database cleaner in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
bkeepers committed Feb 12, 2013
1 parent 7045b03 commit ef20fba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,17 @@

config.expect_with(:rspec) { |c| c.syntax = :expect }

config.use_transactional_fixtures = true
config.use_transactional_fixtures = false

config.before do
DatabaseCleaner.strategy = :transaction
end

config.before do
DatabaseCleaner.start
end

config.after do
DatabaseCleaner.clean
end
end
4 changes: 4 additions & 0 deletions spec/support/acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,8 @@ def be_unlocked
config.after :each, :capybara_feature => true do
page.execute_script 'localStorage.clear()'
end

config.before :each, :capybara_feature => true do
DatabaseCleaner.strategy = :truncation
end
end

0 comments on commit ef20fba

Please sign in to comment.