Skip to content

Instantly share code, notes, and snippets.

@kbredemeier
Created November 23, 2011 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbredemeier/1388814 to your computer and use it in GitHub Desktop.
Save kbredemeier/1388814 to your computer and use it in GitHub Desktop.
Cucumber enviroment
require 'rubygems'
require 'spork'
Spork.prefork do
require 'cucumber/rails'
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'rspec/rails'
require 'capybara/rails'
Capybara.default_selector = :css
Capybara.default_driver = :webkit
end
Spork.each_run do
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
Cucumber::Rails::Database.javascript_strategy = :truncation
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment