Skip to content

Instantly share code, notes, and snippets.

@dreamr
Created June 1, 2011 21:36
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 dreamr/1003383 to your computer and use it in GitHub Desktop.
Save dreamr/1003383 to your computer and use it in GitHub Desktop.
my spec helper
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'authlogic/test_case'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
config.include DatasetSpecHelper
config.include ValidModelAttributes
config.include AuthenticationSpecHelper
config.include Authlogic::TestCase
config.mock_with :rspec
config.before(:suite) do
DatabaseCleaner.strategy = :truncation
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
config.use_transactional_fixtures = false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment