mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Installs database cleaner
- preparation for feature tests with capybara see: http://devblog.avdi.org/2012/08/31/configuring-database_cleaner-with-rails-rspec-capybara-and-selenium/
This commit is contained in:
parent
546977fc02
commit
8aa68fb84a
5 changed files with 33 additions and 7 deletions
22
spec/support/database_cleaner.rb
Normal file
22
spec/support/database_cleaner.rb
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
RSpec.configure do |config|
|
||||
|
||||
config.before(:suite) do
|
||||
DatabaseCleaner.clean_with(:truncation)
|
||||
end
|
||||
|
||||
config.before(:each) do
|
||||
DatabaseCleaner.strategy = :transaction
|
||||
end
|
||||
|
||||
config.before(:each, :js => true) do
|
||||
DatabaseCleaner.strategy = :truncation
|
||||
end
|
||||
|
||||
config.before(:each) do
|
||||
DatabaseCleaner.start
|
||||
end
|
||||
|
||||
config.after(:each) do
|
||||
DatabaseCleaner.clean
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue