2019-03-30 03:23:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-26 13:36:43 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2021-05-20 05:10:30 -04:00
|
|
|
RSpec.describe Integrations::Bugzilla do
|
2016-06-26 13:36:43 -04:00
|
|
|
describe 'Validations' do
|
2021-06-30 20:08:17 -04:00
|
|
|
context 'when integration is active' do
|
2017-06-14 14:18:56 -04:00
|
|
|
before do
|
|
|
|
subject.active = true
|
|
|
|
end
|
2016-06-26 13:36:43 -04:00
|
|
|
|
|
|
|
it { is_expected.to validate_presence_of(:project_url) }
|
|
|
|
it { is_expected.to validate_presence_of(:issues_url) }
|
|
|
|
it { is_expected.to validate_presence_of(:new_issue_url) }
|
2021-06-30 20:08:17 -04:00
|
|
|
it_behaves_like 'issue tracker integration URL attribute', :project_url
|
|
|
|
it_behaves_like 'issue tracker integration URL attribute', :issues_url
|
|
|
|
it_behaves_like 'issue tracker integration URL attribute', :new_issue_url
|
2016-06-26 13:36:43 -04:00
|
|
|
end
|
|
|
|
|
2021-06-30 20:08:17 -04:00
|
|
|
context 'when integration is inactive' do
|
2017-06-14 14:18:56 -04:00
|
|
|
before do
|
|
|
|
subject.active = false
|
|
|
|
end
|
2016-06-26 13:36:43 -04:00
|
|
|
|
|
|
|
it { is_expected.not_to validate_presence_of(:project_url) }
|
|
|
|
it { is_expected.not_to validate_presence_of(:issues_url) }
|
|
|
|
it { is_expected.not_to validate_presence_of(:new_issue_url) }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|