2019-03-30 07:23:56 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-26 17:36:43 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2021-05-20 09:10:30 +00:00
|
|
|
RSpec.describe Integrations::Bugzilla do
|
2016-06-26 17:36:43 +00:00
|
|
|
describe 'Validations' do
|
2021-07-01 00:08:17 +00:00
|
|
|
context 'when integration is active' do
|
2017-06-14 18:18:56 +00:00
|
|
|
before do
|
|
|
|
subject.active = true
|
|
|
|
end
|
2016-06-26 17:36:43 +00: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-07-01 00:08:17 +00: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 17:36:43 +00:00
|
|
|
end
|
|
|
|
|
2021-07-01 00:08:17 +00:00
|
|
|
context 'when integration is inactive' do
|
2017-06-14 18:18:56 +00:00
|
|
|
before do
|
|
|
|
subject.active = false
|
|
|
|
end
|
2016-06-26 17:36:43 +00: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
|