Commit 0b57bebb authored by Brett Walker's avatar Brett Walker

Update jira deployment_type only if allowed

parent ced482c7
...@@ -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