diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-20 21:38:24 +0300 |
commit | 983a0bba5d2a042c4a3bbb22432ec192c7501d82 (patch) | |
tree | b153cd387c14ba23bd5a07514c7c01fddf6a78a0 /spec/workers/gitlab/jira_import/stage/finish_import_worker_spec.rb | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'spec/workers/gitlab/jira_import/stage/finish_import_worker_spec.rb')
-rw-r--r-- | spec/workers/gitlab/jira_import/stage/finish_import_worker_spec.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/spec/workers/gitlab/jira_import/stage/finish_import_worker_spec.rb b/spec/workers/gitlab/jira_import/stage/finish_import_worker_spec.rb index 93e2a44223b..5c3c7dcccc1 100644 --- a/spec/workers/gitlab/jira_import/stage/finish_import_worker_spec.rb +++ b/spec/workers/gitlab/jira_import/stage/finish_import_worker_spec.rb @@ -20,7 +20,7 @@ describe Gitlab::JiraImport::Stage::FinishImportWorker do end context 'when feature flag enabled' do - let_it_be(:jira_import) { create(:jira_import_state, :scheduled, project: project) } + let_it_be(:jira_import, reload: true) { create(:jira_import_state, :scheduled, project: project) } before do stub_feature_flags(jira_issue_import: true) @@ -31,15 +31,27 @@ describe Gitlab::JiraImport::Stage::FinishImportWorker do end context 'when import started' do + let_it_be(:import_label) { create(:label, project: project, title: 'jira-import') } + let_it_be(:imported_issues) { create_list(:labeled_issue, 3, project: project, labels: [import_label]) } + before do + expect(Gitlab::JiraImport).to receive(:get_import_label_id).and_return(import_label.id) + expect(Gitlab::JiraImport).to receive(:issue_failures).and_return(2) + jira_import.start! + worker.perform(project.id) end it 'changes import state to finished' do - worker.perform(project.id) - expect(project.jira_import_status).to eq('finished') end + + it 'saves imported issues counts' do + latest_jira_import = project.latest_jira_import + expect(latest_jira_import.total_issue_count).to eq(5) + expect(latest_jira_import.failed_to_import_count).to eq(2) + expect(latest_jira_import.imported_issues_count).to eq(3) + end end end end |