summaryrefslogtreecommitdiff
path: root/spec/models/project_services
diff options
context:
space:
mode:
authorMehdi Lahmam <mehdi@lahmam.com>2017-08-01 21:19:54 +0200
committerMehdi Lahmam <mehdi@lahmam.com>2017-08-03 15:25:47 +0200
commit03d199fb10bd03c6d6602b23e5f5454dd956e945 (patch)
tree220f82b843531c593485ec84a8b0c29511472f9a /spec/models/project_services
parent56046ca8da989718388095c59e86cfb4a6b77f04 (diff)
downloadgitlab-ce-03d199fb10bd03c6d6602b23e5f5454dd956e945.tar.gz
Ensure `JIRA::Resource::Issue` responds to `resolution` before calling it
Diffstat (limited to 'spec/models/project_services')
-rw-r--r--spec/models/project_services/jira_service_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/project_services/jira_service_spec.rb b/spec/models/project_services/jira_service_spec.rb
index bc9374d6dbb..fcc0f00d01d 100644
--- a/spec/models/project_services/jira_service_spec.rb
+++ b/spec/models/project_services/jira_service_spec.rb
@@ -153,6 +153,15 @@ describe JiraService do
expect(WebMock).not_to have_requested(:post, @remote_link_url)
end
+ it "does not send comment or remote links to issues with unknown resolution" do
+ allow_any_instance_of(JIRA::Resource::Issue).to receive(:respond_to?).with(:resolution).and_return(false)
+
+ @jira_service.close_issue(merge_request, ExternalIssue.new("JIRA-123", project))
+
+ expect(WebMock).not_to have_requested(:post, @comment_url)
+ expect(WebMock).not_to have_requested(:post, @remote_link_url)
+ end
+
it "references the GitLab commit/merge request" do
stub_config_setting(base_url: custom_base_url)