Commit 1fd90ef5 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'rc/backport-ee-fix' into 'master'

Truncate the DB in after(:all) test for Gitlab::ImportExport::ProjectTreeRestorer

See merge request !9339
parents b43cb21d bce00bad
...@@ -3,7 +3,7 @@ include ImportExport::CommonUtil ...@@ -3,7 +3,7 @@ include ImportExport::CommonUtil
describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
describe 'restore project tree' do describe 'restore project tree' do
before(:all) do before(:context) do
@user = create(:user) @user = create(:user)
RSpec::Mocks.with_temporary_scope do RSpec::Mocks.with_temporary_scope do
...@@ -15,10 +15,6 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do ...@@ -15,10 +15,6 @@ describe Gitlab::ImportExport::ProjectTreeRestorer, services: true do
end end
end end
after(:all) do
@user.destroy!
end
context 'JSON' do context 'JSON' do
it 'restores models based on JSON' do it 'restores models based on JSON' do
expect(@restored_project_json).to be true expect(@restored_project_json).to be true
......
...@@ -3,6 +3,10 @@ RSpec.configure do |config| ...@@ -3,6 +3,10 @@ RSpec.configure do |config|
DatabaseCleaner.clean_with(:truncation) DatabaseCleaner.clean_with(:truncation)
end end
config.append_after(:context) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do config.before(:each) do
DatabaseCleaner.strategy = :transaction DatabaseCleaner.strategy = :transaction
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment