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