Commit 180f776d authored by Max Woolf's avatar Max Woolf

Merge branch '330300-ajk-minor-changes' into 'master'

Remove assorted references to integrations as services

See merge request gitlab-org/gitlab!65072
parents 63a9b054 2beff956
......@@ -7,26 +7,26 @@ RSpec.describe Integrations::BaseIssueTracker do
let(:project) { create :project }
describe 'only one issue tracker per project' do
let(:service) { Integrations::Redmine.new(project: project, active: true, issue_tracker_data: build(:issue_tracker_data)) }
let(:integration) { Integrations::Redmine.new(project: project, active: true, issue_tracker_data: build(:issue_tracker_data)) }
before do
create(:custom_issue_tracker_integration, project: project)
end
context 'when service is changed manually by user' do
context 'when integration is changed manually by user' do
it 'executes the validation' do
valid = service.valid?(:manual_change)
valid = integration.valid?(:manual_change)
expect(valid).to be_falsey
expect(service.errors[:base]).to include(
expect(integration.errors[:base]).to include(
'Another issue tracker is already in use. Only one issue tracker service can be active at a time'
)
end
end
context 'when service is changed internally' do
context 'when integration is changed internally' do
it 'does not execute the validation' do
expect(service.valid?).to be_truthy
expect(integration.valid?).to be_truthy
end
end
end
......
......@@ -9,7 +9,7 @@ RSpec.describe Integrations::Bugzilla do
end
describe 'Validations' do
context 'when service is active' do
context 'when integration is active' do
before do
subject.active = true
end
......@@ -17,12 +17,12 @@ RSpec.describe Integrations::Bugzilla do
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) }
it_behaves_like 'issue tracker service URL attribute', :project_url
it_behaves_like 'issue tracker service URL attribute', :issues_url
it_behaves_like 'issue tracker service URL attribute', :new_issue_url
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
end
context 'when service is inactive' do
context 'when integration is inactive' do
before do
subject.active = false
end
......
......@@ -11,7 +11,7 @@ RSpec.describe Integrations::Campfire do
end
describe 'Validations' do
context 'when service is active' do
context 'when integration is active' do
before do
subject.active = true
end
......@@ -19,7 +19,7 @@ RSpec.describe Integrations::Campfire do
it { is_expected.to validate_presence_of(:token) }
end
context 'when service is inactive' do
context 'when integration is inactive' do
before do
subject.active = false
end
......
......@@ -13,7 +13,7 @@ RSpec.describe Integrations::Confluence do
subject.active = active
end
context 'when service is active' do
context 'when integration is active' do
let(:active) { true }
it { is_expected.not_to allow_value('https://example.com').for(:confluence_url) }
......@@ -35,7 +35,7 @@ RSpec.describe Integrations::Confluence do
it { is_expected.to validate_presence_of(:confluence_url) }
end
context 'when service is inactive' do
context 'when integration is inactive' do
let(:active) { false }
it { is_expected.not_to validate_presence_of(:confluence_url) }
......@@ -71,13 +71,13 @@ RSpec.describe Integrations::Confluence do
subject { project.project_setting.has_confluence? }
it 'sets the property to true when service is active' do
it 'sets the property to true when integration is active' do
create(:confluence_integration, project: project, active: true)
is_expected.to be(true)
end
it 'sets the property to false when service is not active' do
it 'sets the property to false when integration is not active' do
create(:confluence_integration, project: project, active: false)
is_expected.to be(false)
......
......@@ -91,7 +91,7 @@ RSpec.describe Integrations::Datadog do
end
end
context 'when service is not active' do
context 'when integration is not active' do
let(:active) { false }
it { is_expected.to be_valid }
......
......@@ -9,16 +9,16 @@ RSpec.describe Integrations::ExternalWiki do
end
describe 'Validations' do
context 'when service is active' do
context 'when integration is active' do
before do
subject.active = true
end
it { is_expected.to validate_presence_of(:external_wiki_url) }
it_behaves_like 'issue tracker service URL attribute', :external_wiki_url
it_behaves_like 'issue tracker integration URL attribute', :external_wiki_url
end
context 'when service is inactive' do
context 'when integration is inactive' do
before do
subject.active = false
end
......
......@@ -9,7 +9,7 @@ RSpec.describe Integrations::Flowdock do
end
describe 'Validations' do
context 'when service is active' do
context 'when integration is active' do
before do
subject.active = true
end
......@@ -17,7 +17,7 @@ RSpec.describe Integrations::Flowdock do
it { is_expected.to validate_presence_of(:token) }
end
context 'when service is inactive' do
context 'when integration is inactive' do
before do
subject.active = false
end
......
......@@ -20,7 +20,7 @@ RSpec.describe Integrations::PipelinesEmail, :mailer do
end
describe 'Validations' do
context 'when service is active' do
context 'when integration is active' do
before do
subject.active = true
end
......@@ -28,7 +28,7 @@ RSpec.describe Integrations::PipelinesEmail, :mailer do
it { is_expected.to validate_presence_of(:recipients) }
end
context 'when service is inactive' do
context 'when integration is inactive' do
before do
subject.active = false
end
......
......@@ -11,7 +11,7 @@ RSpec.describe Integrations::Pushover do
end
describe 'Validations' do
context 'when service is active' do
context 'when integration is active' do
before do
subject.active = true
end
......@@ -21,7 +21,7 @@ RSpec.describe Integrations::Pushover do
it { is_expected.to validate_presence_of(:priority) }
end
context 'when service is inactive' do
context 'when integration is inactive' do
before do
subject.active = false
end
......
......@@ -18,7 +18,7 @@ RSpec.describe Integrations::SlackSlashCommands do
}
end
let(:service) do
let(:integration) do
project.create_slack_slash_commands_integration(
properties: { token: 'token' },
active: true
......@@ -30,11 +30,11 @@ RSpec.describe Integrations::SlackSlashCommands do
end
before do
allow(service).to receive(:authorize_chat_name_url).and_return(authorize_url)
allow(integration).to receive(:authorize_chat_name_url).and_return(authorize_url)
end
it 'uses slack compatible links' do
response = service.trigger(params)
response = integration.trigger(params)
expect(response[:text]).to include("<#{authorize_url}|connect your GitLab account>")
end
......
......@@ -13,7 +13,7 @@ RSpec.shared_examples "chat integration" do |integration_name|
end
it { is_expected.to validate_presence_of(:webhook) }
it_behaves_like "issue tracker service URL attribute", :webhook
it_behaves_like "issue tracker integration URL attribute", :webhook
end
context "when integration is inactive" do
......
......@@ -23,7 +23,7 @@ RSpec.shared_examples Integrations::SlackMattermostNotifier do |service_name|
end
it { is_expected.to validate_presence_of(:webhook) }
it_behaves_like 'issue tracker service URL attribute', :webhook
it_behaves_like 'issue tracker integration URL attribute', :webhook
end
context 'when service is inactive' 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