mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
- preparation for feature tests with capybara see: http://devblog.avdi.org/2012/08/31/configuring-database_cleaner-with-rails-rspec-capybara-and-selenium/
22 lines
393 B
Ruby
22 lines
393 B
Ruby
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
|