Commit 2013755c authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '247870-nomethoderror-saving-jira-integration-with-invalid-credentials' into 'master'

Resolve "NoMethodError - Saving Jira integration with invalid credentials"

Closes #247870

See merge request gitlab-org/gitlab!42361
parents 22d8f04c 0b57bebb
...@@ -439,7 +439,8 @@ class JiraService < IssueTrackerService ...@@ -439,7 +439,8 @@ class JiraService < IssueTrackerService
end end
def update_deployment_type? def update_deployment_type?
api_url_changed? || url_changed? || username_changed? || password_changed? (api_url_changed? || url_changed? || username_changed? || password_changed?) &&
can_test?
end end
def update_deployment_type def update_deployment_type
......
---
title: Fix exception when saving Jira integration info for an instance
merge_request: 42361
author:
type: fixed
...@@ -254,6 +254,16 @@ RSpec.describe JiraService do ...@@ -254,6 +254,16 @@ RSpec.describe JiraService do
end end
end end
context 'when not allowed to test an instance or group' do
it 'does not update deployment type' do
allow(service).to receive(:can_test?).and_return(false)
service.update!(url: 'http://first.url')
expect(WebMock).not_to have_requested(:get, /serverInfo/)
end
end
context 'stored password invalidation' do context 'stored password invalidation' do
context 'when a password was previously set' do context 'when a password was previously set' do
context 'when only web url present' do context 'when only web url present' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment