Created
March 20, 2012 00:08
-
-
Save leandrocp/2128772 to your computer and use it in GitHub Desktop.
spec_helper.rb
This file contains hidden or 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 'spork' | |
#require 'spork/ext/ruby-debug' | |
Spork.prefork do | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
require 'rspec/autorun' | |
require 'capybara/rspec' | |
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} | |
RSpec.configure do |config| | |
config.use_transactional_fixtures = true | |
config.infer_base_class_for_anonymous_controllers = false | |
config.before(:suite) do | |
DatabaseCleaner.strategy = :truncation | |
end | |
config.before(:each) do | |
DatabaseCleaner.start | |
end | |
config.after(:each) do | |
DatabaseCleaner.clean | |
end | |
end | |
end | |
Spork.each_run do | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment