mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
transactional db support for capybara tests!
This commit is contained in:
parent
1b9a12746d
commit
a9e8498abe
7 changed files with 43 additions and 30 deletions
|
|
@ -2,17 +2,16 @@
|
|||
|
||||
RSpec.configure do |config|
|
||||
config.before(:suite) do
|
||||
DatabaseCleaner.clean_with(:truncation)
|
||||
DatabaseCleaner.clean_with(:transaction)
|
||||
Rails.application.load_seed
|
||||
end
|
||||
|
||||
config.before(:each) do |example|
|
||||
DatabaseCleaner.strategy = example.metadata[:js] == true ? :truncation : :transaction
|
||||
config.before(:each) do
|
||||
DatabaseCleaner.start
|
||||
end
|
||||
|
||||
config.after(:each) do |example|
|
||||
TransactionalCapybara::AjaxHelpers.wait_for_ajax(page) if example.metadata[:js]
|
||||
DatabaseCleaner.clean
|
||||
Rails.application.load_seed if example.metadata[:js] == true
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue