Skip to content

Instantly share code, notes, and snippets.

@yoshitsugu
Created July 24, 2013 04:31
Show Gist options
  • Save yoshitsugu/6068080 to your computer and use it in GitHub Desktop.
Save yoshitsugu/6068080 to your computer and use it in GitHub Desktop.
database_cleaner transactionの設定 ref: http://qiita.com/yoshitsugu@github/items/3470dbcadfdd677be543
Spork.prefork do
...
RSpec.configure do |config|
....
# for database_clener
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation,{:except => %w{except_tables}})
DatabaseCleaner.strategy = :transaction
end
config.before(:each) do
DatabaseCleaner.start
end
config.after(:each) do
DatabaseCleaner.clean
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment