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/models/jira_import_state_spec.rb | |
parent | a2bddee2cdb38673df0e004d5b32d9f77797de64 (diff) |
Add latest changes from gitlab-org/gitlab@12-10-stable-ee
Diffstat (limited to 'spec/models/jira_import_state_spec.rb')
-rw-r--r-- | spec/models/jira_import_state_spec.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/spec/models/jira_import_state_spec.rb b/spec/models/jira_import_state_spec.rb index f75a17f71b2..4d91bf25b5e 100644 --- a/spec/models/jira_import_state_spec.rb +++ b/spec/models/jira_import_state_spec.rb @@ -130,8 +130,10 @@ describe JiraImportState do context 'after transition to finished' do let!(:jira_import) { build(:jira_import_state, :started, jid: 'some-other-jid', project: project)} + subject { jira_import.finish } + it 'triggers the import job' do - jira_import.finish + subject expect(jira_import.jid).to be_nil end @@ -139,11 +141,25 @@ describe JiraImportState do it 'triggers the import job' do jira_import.update!(status: :scheduled) - jira_import.finish + subject expect(jira_import.status).to eq('scheduled') expect(jira_import.jid).to eq('some-other-jid') end + + it 'updates the record with imported issues counts' do + import_label = create(:label, project: project, title: 'jira-import') + create_list(:labeled_issue, 3, project: project, labels: [import_label]) + + expect(Gitlab::JiraImport).to receive(:get_import_label_id).and_return(import_label.id) + expect(Gitlab::JiraImport).to receive(:issue_failures).and_return(2) + + subject + + expect(jira_import.total_issue_count).to eq(5) + expect(jira_import.failed_to_import_count).to eq(2) + expect(jira_import.imported_issues_count).to eq(3) + end end end end |