Skip to content

Instantly share code, notes, and snippets.

@petRUShka
Created February 3, 2011 23:06
Show Gist options
  • Save petRUShka/810418 to your computer and use it in GitHub Desktop.
Save petRUShka/810418 to your computer and use it in GitHub Desktop.
cucumber config with spork
require 'rubygems'
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
require 'cucumber/rails/world'
require 'cucumber/rails/active_record'
require 'cucumber/web/tableish'
require 'email_spec/cucumber'
require 'capybara/rails'
require 'capybara/cucumber'
require 'capybara/session'
require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript
Capybara.default_selector = :css
end
Spork.each_run do
ActionController::Base.allow_rescue = false
Cucumber::Rails::World.use_transactional_fixtures = true
if defined?(ActiveRecord::Base)
begin
require 'database_cleaner'
DatabaseCleaner.strategy = :truncation
rescue LoadError => ignore_if_database_cleaner_not_present
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment