Skip to content

Instantly share code, notes, and snippets.

@tdouce
Last active August 29, 2015 14:03
Show Gist options
  • Save tdouce/1944a229937b69ef2a3c to your computer and use it in GitHub Desktop.
Save tdouce/1944a229937b69ef2a3c to your computer and use it in GitHub Desktop.
Part of 'Testing Rails Service Oriented Architecture' blog
# spec/spec_helper.rb in client
...
require 'rspec/rails'
require 'database_cleaner'
...
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.strategy = :transaction
DatabaseCleaner.clean_with(:truncation)
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