diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 06:09:37 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 06:09:37 +0000 |
commit | 0301a0cad0063d76b1607358dc6c711ea043fdda (patch) | |
tree | 894ac424a6fb370ad8dc5de4294cdc87f0ae164e /spec/services/issues | |
parent | dcce066c5059c4df112dce4a9edf288d74aec48b (diff) | |
download | gitlab-ce-0301a0cad0063d76b1607358dc6c711ea043fdda.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/close_service_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb index fa4e6ddb088..d8bcd8008ce 100644 --- a/spec/services/issues/close_service_spec.rb +++ b/spec/services/issues/close_service_spec.rb @@ -70,6 +70,38 @@ describe Issues::CloseService do end describe '#close_issue' do + context 'with external issue' do + context 'with an active external issue tracker supporting close_issue' do + let!(:external_issue_tracker) { create(:jira_service, project: project) } + + it 'closes the issue on the external issue tracker' do + expect(project.external_issue_tracker).to receive(:close_issue) + + described_class.new(project, user).close_issue(external_issue) + end + end + + context 'with innactive external issue tracker supporting close_issue' do + let!(:external_issue_tracker) { create(:jira_service, project: project, active: false) } + + it 'does not close the issue on the external issue tracker' do + expect(project.external_issue_tracker).not_to receive(:close_issue) + + described_class.new(project, user).close_issue(external_issue) + end + end + + context 'with an active external issue tracker not supporting close_issue' do + let!(:external_issue_tracker) { create(:bugzilla_service, project: project) } + + it 'does not close the issue on the external issue tracker' do + expect(project.external_issue_tracker).not_to receive(:close_issue) + + described_class.new(project, user).close_issue(external_issue) + end + end + end + context "closed by a merge request", :sidekiq_might_not_need_inline do it 'mentions closure via a merge request' do perform_enqueued_jobs do |