Skip to content

Instantly share code, notes, and snippets.

@jdelStrother
Created August 26, 2013 20:05
Show Gist options
  • Select an option

  • Save jdelStrother/6345998 to your computer and use it in GitHub Desktop.

Select an option

Save jdelStrother/6345998 to your computer and use it in GitHub Desktop.
RSpec.configure do |config|
no_transactions = lambda do |example|
self.use_transactional_fixtures = false
DatabaseCleaner.start
example.run
DatabaseCleaner.clean
end
config.around(:type=>:feature, &no_transactions)
config.around(transanctionless: true, &no_transactions.dup) # for some reason rspec loses the previous use of this block if you don't dup it.
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment