diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 03:09:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 03:09:34 +0300 |
commit | 3cd08f4bf96cda3e9d3abf233095107832b17c20 (patch) | |
tree | dc09a618783a79d70f2a404374d4b850ccf9cc84 /spec/models/project_services | |
parent | dd4bee69b7d55620f7dc9db8c36b478bd4959755 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/project_services')
-rw-r--r-- | spec/models/project_services/jira_service_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb index c1e7a1c2875..32e6b5afce5 100644 --- a/spec/models/project_services/jira_service_spec.rb +++ b/spec/models/project_services/jira_service_spec.rb @@ -440,6 +440,27 @@ describe JiraService do end end + context 'when Remote Link already exists' do + let(:remote_link) do + double( + 'remote link', + object: { + url: "#{Gitlab.config.gitlab.url}/#{project.full_path}/-/commit/#{commit_id}" + }.with_indifferent_access + ) + end + + it 'does not create comment' do + allow(JIRA::Resource::Remotelink).to receive(:all).and_return([remote_link]) + + expect(remote_link).to receive(:save!) + + @jira_service.close_issue(resource, ExternalIssue.new('JIRA-123', project)) + + expect(WebMock).not_to have_requested(:post, @comment_url) + end + end + it 'does not send comment or remote links to issues already closed' do allow_any_instance_of(JIRA::Resource::Issue).to receive(:resolution).and_return(true) |