From e5be289d1ec7542bc9664e8f0c384bfe5c26a919 Mon Sep 17 00:00:00 2001 From: Michael Kaiser-Nyman Date: Thu, 7 Mar 2013 11:46:37 -0800 Subject: [PATCH] remove transactions stuff from Test::Unit section ... as there is a specific section about it further down. --- README.md | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 8c822580..88db0c04 100644 --- a/README.md +++ b/README.md @@ -162,36 +162,14 @@ end ## Using Capybara with Test::Unit -* If you are using Rails, add `database_cleaner` to your Gemfile: - - ```ruby - group :test do - gem 'database_cleaner' - end - ``` - - Then add the following code in your `test_helper.rb` file to make - Capybara available in all test cases deriving from +* If you are using Rails, add the following code in your `test_helper.rb` + file to make Capybara available in all test cases deriving from `ActionDispatch::IntegrationTest`: ```ruby - # Transactional fixtures do not work with Selenium tests, because Capybara - # uses a separate server thread, which the transactions would be hidden - # from. We hence use DatabaseCleaner to truncate our test database. - DatabaseCleaner.strategy = :truncation - class ActionDispatch::IntegrationTest # Make the Capybara DSL available in all integration tests include Capybara::DSL - - # Stop ActiveRecord from wrapping tests in transactions - self.use_transactional_fixtures = false - - teardown do - DatabaseCleaner.clean # Truncate the database - Capybara.reset_sessions! # Forget the (simulated) browser state - Capybara.use_default_driver # Revert Capybara.current_driver to Capybara.default_driver - end end ```