Created
February 8, 2013 15:47
-
-
Save jjeffers/4739850 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Spec::Runner.configure do |config| | |
config.include Capybara::DSL | |
config.use_transactional_fixtures = true | |
config.use_instantiated_fixtures = false | |
config.fixture_path = RAILS_ROOT + '/test/fixtures/' | |
config.before(:suite) do | |
DatabaseCleaner.clean_with(:truncation) | |
end | |
config.before(:each) do | |
if options[:js] | |
Capybara.current_driver = :poltergeist | |
DatabaseCleaner.strategy = :truncation | |
config.use_transactional_fixtures = false | |
load_fixtures | |
else | |
DatabaseCleaner.strategy = :transaction | |
end | |
DatabaseCleaner.start | |
end | |
config.after(:each) do | |
DatabaseCleaner.clean | |
if options[:js] | |
Capybara.use_default_driver | |
config.use_transactional_fixtures = true | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment