Created
May 18, 2012 23:06
-
-
Save mattbrictson/2728030 to your computer and use it in GitHub Desktop.
Faster Capybara Specs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'database_cleaner', group: :test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |config| | |
# ... | |
config.use_transactional_fixtures = false | |
config.before(:each) do | |
DatabaseCleaner.strategy = if example.metadata[:js] | |
:truncation | |
else | |
:transaction | |
end | |
DatabaseCleaner.start | |
end | |
config.after(:each) do | |
DatabaseCleaner.clean | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This also fixed some other issues rspec+capybara-webkit was having as well. Thanks!