Browse files

Merge pull request #1026 from michaelrkn/e5be289d1ec7542bc9664e8f0c38…

…4bfe5c26a919

remove transactions stuff from Test::Unit section of readme
  • Loading branch information...
2 parents 8121c04 + e5be289 commit c5e46fdcc84eaed8c8e655a35156603d9f1af958 @jnicklas committed Mar 26, 2013
Showing with 2 additions and 24 deletions.
  1. +2 −24 README.md
View
26 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
```

0 comments on commit c5e46fd

Please sign in to comment.