Commit 0e08959b authored by Nick Thomas's avatar Nick Thomas

Merge branch '325281-valida-jira-connect-installation-instance_url' into 'master'

Add public_url validation to JC instance_url

See merge request gitlab-org/gitlab!67043
parents d47b684e 1a0c4404
......@@ -11,6 +11,7 @@ class JiraConnectInstallation < ApplicationRecord
validates :client_key, presence: true, uniqueness: true
validates :shared_secret, presence: true
validates :base_url, presence: true, public_url: true
validates :instance_url, public_url: true, allow_blank: true
scope :for_project, -> (project) {
distinct
......
......@@ -15,6 +15,9 @@ RSpec.describe JiraConnectInstallation do
it { is_expected.to allow_value('https://test.atlassian.net').for(:base_url) }
it { is_expected.not_to allow_value('not/a/url').for(:base_url) }
it { is_expected.to allow_value('https://test.atlassian.net').for(:instance_url) }
it { is_expected.not_to allow_value('not/a/url').for(:instance_url) }
end
describe '.for_project' 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