Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Add Comment
Please, Sign In to add comment