Skip to content

Instantly share code, notes, and snippets.

@panSarin
Created January 17, 2012 17:31
Show Gist options
  • Save panSarin/1627695 to your computer and use it in GitHub Desktop.
Save panSarin/1627695 to your computer and use it in GitHub Desktop.
spec_helper
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
Dir[Rails.root.join("spec/support/*.rb")].each {|f| require f}
DatabaseCleaner.strategy = :truncation
DatabaseCleaner.clean_with(:truncation)
RSpec.configure do |config|
config.after(:all) do
GC.enable
GC.start
end
config.fixture_path = "#{::Rails.root}/spec/fixtures"
config.use_transactional_fixtures = true
config.infer_base_class_for_anonymous_controllers = false
config.include Devise::TestHelpers, :type => :controller
config.extend ControllerMacros, :type => :controller
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment