Created
September 15, 2011 04:35
-
-
Save fivetwentysix/1218541 to your computer and use it in GitHub Desktop.
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
require 'rubygems' | |
require 'spork' | |
Spork.prefork do | |
ENV["RAILS_ENV"] ||= "test" | |
require 'cucumber/rails' | |
require 'factory_girl' | |
Capybara.default_selector = :css | |
Capybara.javascript_driver = :webkit | |
Capybara.default_wait_time = 5 | |
end | |
Spork.each_run do | |
FactoryGirl.reload | |
ActionController::Base.allow_rescue = false | |
begin | |
DatabaseCleaner.strategy = :transaction | |
rescue NameError | |
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it." | |
end | |
Before('@no-txn,@selenium,@culerity,@celerity,@javascript') do | |
DatabaseCleaner.strategy = :truncation, {:except => %w[widgets]} | |
DatabaseCleaner.start | |
end | |
Before('~@no-txn', '~@selenium', '~@culerity', '~@celerity', '~@javascript') do | |
DatabaseCleaner.strategy = :transaction | |
end | |
After('@no-txn,@selenium,@culerity,@celerity,@javascript') do | |
DatabaseCleaner.clean | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment