Skip to content

Instantly share code, notes, and snippets.

@lukeledet
Created March 12, 2011 14:29
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 lukeledet/867274 to your computer and use it in GitHub Desktop.
Save lukeledet/867274 to your computer and use it in GitHub Desktop.
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/rails'
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support
Capybara.default_selector = :css
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
Spork.each_run do
# This code will be run each time you run your specs.
load "#{Rails.root}/config/routes.rb"
load "#{Rails.root}/features/support/paths.rb"
Dir["#{Rails.root}/app/**/*.rb"].each { |f| load f }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment