Skip to content

Instantly share code, notes, and snippets.

@bradrobertson
Created May 8, 2013 16:09
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 bradrobertson/5541546 to your computer and use it in GitHub Desktop.
Save bradrobertson/5541546 to your computer and use it in GitHub Desktop.
sample spec_helper.rb
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with :truncation
DatabaseCleaner.strategy = :transaction
seed_db_with_lots_of_data # for example
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment