Commit affb8e23 authored by Alex Kalderimis's avatar Alex Kalderimis

Rename redmine service to integration

Renames the redmine project association from _service to _integration.
parent f296268b
......@@ -51,6 +51,7 @@ class Integration < ApplicationRecord
jenkins jira
packagist pipelines_email pivotaltracker pushover
mattermost mattermost_slash_commands microsoft_teams mock_ci mock_monitoring
redmine
].to_set.freeze
def self.renamed?(name)
......
......@@ -184,7 +184,7 @@ class Project < ApplicationRecord
has_one :pivotaltracker_integration, class_name: 'Integrations::Pivotaltracker'
has_one :prometheus_service, class_name: 'Integrations::Prometheus', inverse_of: :project
has_one :pushover_integration, class_name: 'Integrations::Pushover'
has_one :redmine_service, class_name: 'Integrations::Redmine'
has_one :redmine_integration, class_name: 'Integrations::Redmine'
has_one :slack_service, class_name: 'Integrations::Slack'
has_one :slack_slash_commands_service, class_name: 'Integrations::SlackSlashCommands'
has_one :teamcity_service, class_name: 'Integrations::Teamcity'
......
......@@ -91,7 +91,7 @@ FactoryBot.define do
issue_tracker
end
factory :redmine_service, class: 'Integrations::Redmine' do
factory :redmine_integration, class: 'Integrations::Redmine' do
project
active { true }
issue_tracker
......
......@@ -396,7 +396,7 @@ FactoryBot.define do
factory :redmine_project, parent: :project do
has_external_issue_tracker { true }
redmine_service
redmine_integration
end
factory :youtrack_project, parent: :project do
......
......@@ -118,7 +118,7 @@ RSpec.describe Banzai::Filter::References::ExternalIssueReferenceFilter do
end
context "redmine project" do
let_it_be(:service) { create(:redmine_service, project: project) }
let_it_be(:integration) { create(:redmine_integration, project: project) }
before do
project.update!(issues_enabled: false)
......
......@@ -387,7 +387,7 @@ project:
- teamcity_service
- pushover_integration
- jira_integration
- redmine_service
- redmine_integration
- youtrack_service
- custom_issue_tracker_integration
- bugzilla_integration
......
......@@ -70,7 +70,7 @@ RSpec.describe Integration do
describe '.by_type' do
let!(:service1) { create(:jira_integration) }
let!(:service2) { create(:jira_integration) }
let!(:service3) { create(:redmine_service) }
let!(:service3) { create(:redmine_integration) }
subject { described_class.by_type(type) }
......
......@@ -61,7 +61,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:bamboo_integration) }
it { is_expected.to have_one(:teamcity_service) }
it { is_expected.to have_one(:jira_integration) }
it { is_expected.to have_one(:redmine_service) }
it { is_expected.to have_one(:redmine_integration) }
it { is_expected.to have_one(:youtrack_service) }
it { is_expected.to have_one(:custom_issue_tracker_integration) }
it { is_expected.to have_one(:bugzilla_integration) }
......
......@@ -9,7 +9,7 @@ RSpec.describe 'query Jira service' do
let_it_be(:project) { create(:project) }
let_it_be(:jira_integration) { create(:jira_integration, project: project) }
let_it_be(:bugzilla_integration) { create(:bugzilla_integration, project: project) }
let_it_be(:redmine_service) { create(:redmine_service, project: project) }
let_it_be(:redmine_integration) { create(:redmine_integration, project: project) }
let(:query) do
%(
......
......@@ -20,7 +20,7 @@ RSpec.describe Admin::PropagateIntegrationService do
end
let_it_be(:different_type_inherited_integration) do
create(:redmine_service, project: project, inherit_from_id: instance_integration.id)
create(:redmine_integration, project: project, inherit_from_id: instance_integration.id)
end
context 'with inherited integration' do
......
......@@ -15,7 +15,7 @@ RSpec.describe 'projects/services/_form' do
current_user: user,
can?: true,
current_application_settings: Gitlab::CurrentSettings.current_application_settings,
integration: project.redmine_service,
integration: project.redmine_integration,
request: double(referer: '/services')
)
end
......
......@@ -8,7 +8,7 @@ RSpec.describe PropagateIntegrationGroupWorker do
let_it_be(:another_group) { create(:group) }
let_it_be(:subgroup1) { create(:group, parent: group) }
let_it_be(:subgroup2) { create(:group, parent: group) }
let_it_be(:integration) { create(:redmine_service, :instance) }
let_it_be(:integration) { create(:redmine_integration, :instance) }
let(:job_args) { [integration.id, group.id, subgroup2.id] }
......@@ -22,7 +22,7 @@ RSpec.describe PropagateIntegrationGroupWorker do
end
context 'with a group integration' do
let_it_be(:integration) { create(:redmine_service, group: group, project: nil) }
let_it_be(:integration) { create(:redmine_integration, group: group, project: nil) }
it 'calls to BulkCreateIntegrationService' do
expect(BulkCreateIntegrationService).to receive(:new)
......
......@@ -5,8 +5,8 @@ require 'spec_helper'
RSpec.describe PropagateIntegrationInheritDescendantWorker do
let_it_be(:group) { create(:group) }
let_it_be(:subgroup) { create(:group, parent: group) }
let_it_be(:group_integration) { create(:redmine_service, group: group, project: nil) }
let_it_be(:subgroup_integration) { create(:redmine_service, group: subgroup, project: nil, inherit_from_id: group_integration.id) }
let_it_be(:group_integration) { create(:redmine_integration, group: group, project: nil) }
let_it_be(:subgroup_integration) { create(:redmine_integration, group: subgroup, project: nil, inherit_from_id: group_integration.id) }
it_behaves_like 'an idempotent worker' do
let(:job_args) { [group_integration.id, subgroup_integration.id, subgroup_integration.id] }
......
......@@ -4,10 +4,10 @@ require 'spec_helper'
RSpec.describe PropagateIntegrationInheritWorker do
describe '#perform' do
let_it_be(:integration) { create(:redmine_service, :instance) }
let_it_be(:integration1) { create(:redmine_service, inherit_from_id: integration.id) }
let_it_be(:integration) { create(:redmine_integration, :instance) }
let_it_be(:integration1) { create(:redmine_integration, inherit_from_id: integration.id) }
let_it_be(:integration2) { create(:bugzilla_integration, inherit_from_id: integration.id) }
let_it_be(:integration3) { create(:redmine_service) }
let_it_be(:integration3) { create(:redmine_integration) }
it_behaves_like 'an idempotent worker' do
let(:job_args) { [integration.id, integration1.id, integration3.id] }
......
......@@ -8,7 +8,7 @@ RSpec.describe PropagateIntegrationProjectWorker do
let_it_be(:project1) { create(:project) }
let_it_be(:project2) { create(:project, group: group) }
let_it_be(:project3) { create(:project, group: group) }
let_it_be(:integration) { create(:redmine_service, :instance) }
let_it_be(:integration) { create(:redmine_integration, :instance) }
let(:job_args) { [integration.id, project1.id, project3.id] }
......@@ -22,7 +22,7 @@ RSpec.describe PropagateIntegrationProjectWorker do
end
context 'with a group integration' do
let_it_be(:integration) { create(:redmine_service, group: group, project: nil) }
let_it_be(:integration) { create(:redmine_integration, group: group, project: nil) }
it 'calls to BulkCreateIntegrationService' do
expect(BulkCreateIntegrationService).to receive(:new)
......
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