Skip to content

Instantly share code, notes, and snippets.

@mipearson
Forked from pacoguzman/env.rb
Created July 8, 2012 08:32
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 mipearson/3069982 to your computer and use it in GitHub Desktop.
Save mipearson/3069982 to your computer and use it in GitHub Desktop.
features/support/env.rb for use with Rails 3 & Spork
# -*- 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