jira_connect_installation_spec.rb 651 Bytes
Newer Older
1 2 3 4 5
# frozen_string_literal: true

require 'spec_helper'

describe JiraConnectInstallation do
6 7 8 9
  describe 'associations' do
    it { is_expected.to have_many(:subscriptions).class_name('JiraConnectSubscription') }
  end

10 11
  describe 'validations' do
    it { is_expected.to validate_presence_of(:client_key) }
12
    it { is_expected.to validate_uniqueness_of(:client_key) }
13 14 15 16 17 18 19
    it { is_expected.to validate_presence_of(:shared_secret) }
    it { is_expected.to validate_presence_of(:base_url) }

    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) }
  end
end