Commit 1a0c4404 authored by Andy Soiron's avatar Andy Soiron

Add public_url validation to JC instance_url

parent 93e5974e
......@@ -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