-
-
Save mipearson/3069982 to your computer and use it in GitHub Desktop.
features/support/env.rb for use with Rails 3 & Spork
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
# -*- encoding : utf-8 -*- | |
require 'rubygems' | |
require 'spork' | |
# From https://gist.github.com/123370 | |
Spork.prefork do | |
ActiveSupport::Deprecation.silenced = true | |
# Sets up the Rails environment for Cucumber | |
ENV["RAILS_ENV"] ||= "cucumber" | |
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') | |
require 'cucumber/rails' | |
require 'thinking_sphinx/test' | |
require 'factory_girl_rails' | |
require 'cucumber/thinking_sphinx/external_world' | |
Cucumber::ThinkingSphinx::ExternalWorld.new | |
ThinkingSphinx::Test.start | |
end | |
Spork.each_run do | |
ActiveSupport::Deprecation.silenced = true | |
ActionController::Base.allow_rescue = false | |
# This code will be run each time you run your specs. | |
require 'cucumber/rails/world' | |
Capybara.default_selector = :css | |
FactoryGirl.reload | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment