Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 21:09:16 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-08 21:09:16 +0300
commit80e9fdc9682cfbcfb9202a2733605a6a6bd23f05 (patch)
tree168375ea13d1a1f01d4cbcf6f0513fc9883e9477 /spec/models
parent5372e109c0660e4670aa987568a51082beca1b3c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_import_state_spec.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/models/project_import_state_spec.rb b/spec/models/project_import_state_spec.rb
index 157477767af..720dc4f435f 100644
--- a/spec/models/project_import_state_spec.rb
+++ b/spec/models/project_import_state_spec.rb
@@ -14,8 +14,8 @@ describe ProjectImportState, type: :model do
end
describe 'Project import job' do
- let(:import_state) { create(:import_state, import_url: generate(:url)) }
- let(:project) { import_state.project }
+ let_it_be(:import_state) { create(:import_state, import_url: generate(:url)) }
+ let_it_be(:project) { import_state.project }
before do
allow_any_instance_of(Gitlab::GitalyClient::RepositoryService).to receive(:import_repository)
@@ -29,8 +29,16 @@ describe ProjectImportState, type: :model do
it 'imports a project', :sidekiq_might_not_need_inline do
expect(RepositoryImportWorker).to receive(:perform_async).and_call_original
- expect { import_state.schedule }.to change { import_state.jid }
- expect(import_state.status).to eq('finished')
+ expect { import_state.schedule }.to change { import_state.status }.from('none').to('finished')
+ end
+
+ it 'records job and correlation IDs', :sidekiq_might_not_need_inline do
+ allow(Labkit::Correlation::CorrelationId).to receive(:current_or_new_id).and_return('abc')
+
+ import_state.schedule
+
+ expect(import_state.jid).to be_an_instance_of(String)
+ expect(import_state.correlation_id).to eq('abc')
end
end