Created
September 7, 2011 07:35
-
-
Save fivetwentysix/1199982 to your computer and use it in GitHub Desktop.
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
require 'rubygems' | |
require 'spork' | |
ENV["RAILS_ENV"] ||= 'test' | |
Spork.prefork do | |
# Loading more in this block will cause your tests to run faster. However, | |
# if you change any configuration or code from libraries loaded here, you'll | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'capybara/rspec' | |
require 'capybara/rails' | |
require 'factory_girl_rails' | |
require 'shoulda/integrations/rspec2' | |
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
Capybara.default_wait_time = 1 | |
RSpec.configure do |config| | |
config.include Devise::TestHelpers, :type => :controller | |
config.mock_with :rspec | |
config.use_transactional_fixtures = false | |
config.before(:suite) do | |
DatabaseCleaner.strategy = :truncation | |
end | |
config.before(:each) do | |
DatabaseCleaner.start | |
end | |
config.after(:each) do | |
DatabaseCleaner.clean | |
end | |
end | |
# need to restart spork for it take effect. | |
end | |
Spork.each_run do | |
FactoryGirl.reload | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment