Commit fa426857 authored by Alex Kalderimis's avatar Alex Kalderimis

Rename custom_issue_tracker_service to *_integration

This renames the `custom_issue_tracker_service` to
`custom_issue_tracker_integration`, on a method and factory level.
parent f670c1ee
......@@ -42,7 +42,7 @@ class Integration < ApplicationRecord
RENAMED_TO_INTEGRATION = %w[
asana assembla
bamboo bugzilla buildkite
campfire confluence
campfire confluence custom_issue_tracker
].to_set.freeze
serialize :properties, JSON # rubocop:disable Cop/ActiveRecordSerialize
......
......@@ -162,7 +162,7 @@ class Project < ApplicationRecord
has_one :buildkite_integration, class_name: 'Integrations::Buildkite'
has_one :campfire_integration, class_name: 'Integrations::Campfire'
has_one :confluence_integration, class_name: 'Integrations::Confluence'
has_one :custom_issue_tracker_service, class_name: 'Integrations::CustomIssueTracker'
has_one :custom_issue_tracker_integration, class_name: 'Integrations::CustomIssueTracker'
has_one :datadog_service, class_name: 'Integrations::Datadog'
has_one :discord_service, class_name: 'Integrations::Discord'
has_one :drone_ci_service, class_name: 'Integrations::DroneCi'
......
......@@ -14,7 +14,7 @@ RSpec.describe Sidebars::Projects::Menus::JiraMenu do
describe 'render?' do
context 'when issue tracker is not Jira' do
it 'returns false' do
create(:custom_issue_tracker_service, active: true, project: project, project_url: 'http://test.com')
create(:custom_issue_tracker_integration, active: true, project: project, project_url: 'http://test.com')
expect(subject.render?).to eq false
end
......
......@@ -310,7 +310,7 @@ RSpec.describe Projects::IssuesController do
context 'external issue tracker' do
let!(:service) do
create(:custom_issue_tracker_service, project: project, new_issue_url: 'http://test.com')
create(:custom_issue_tracker_integration, project: project, new_issue_url: 'http://test.com')
end
before do
......
......@@ -6,7 +6,7 @@ FactoryBot.define do
type { 'Integration' }
end
factory :custom_issue_tracker_service, class: 'Integrations::CustomIssueTracker' do
factory :custom_issue_tracker_integration, class: 'Integrations::CustomIssueTracker' do
project
active { true }
issue_tracker
......
......@@ -7,7 +7,7 @@ RSpec.describe Projects::ServicesController, '(JavaScript fixtures)', type: :con
let(:namespace) { create(:namespace, name: 'frontend-fixtures' )}
let(:project) { create(:project_empty_repo, namespace: namespace, path: 'services-project') }
let!(:service) { create(:custom_issue_tracker_service, project: project) }
let!(:service) { create(:custom_issue_tracker_integration, project: project) }
let(:user) { project.owner }
render_views
......
......@@ -10,7 +10,7 @@ RSpec.describe Types::Projects::ServiceType do
expect(described_class.resolve_type(build(:jira_service), {})).to eq(Types::Projects::Services::JiraServiceType)
expect(described_class.resolve_type(build(:service), {})).to eq(Types::Projects::Services::BaseServiceType)
expect(described_class.resolve_type(build(:drone_ci_service), {})).to eq(Types::Projects::Services::BaseServiceType)
expect(described_class.resolve_type(build(:custom_issue_tracker_service), {})).to eq(Types::Projects::Services::BaseServiceType)
expect(described_class.resolve_type(build(:custom_issue_tracker_integration), {})).to eq(Types::Projects::Services::BaseServiceType)
end
end
end
......@@ -390,7 +390,7 @@ project:
- jira_service
- redmine_service
- youtrack_service
- custom_issue_tracker_service
- custom_issue_tracker_integration
- bugzilla_integration
- ewm_service
- external_wiki_service
......
......@@ -20,7 +20,7 @@ RSpec.describe Sidebars::Projects::Menus::ExternalIssueTrackerMenu do
end
context 'when active external issue tracker' do
let(:external_issue_tracker) { build(:custom_issue_tracker_service, project: project) }
let(:external_issue_tracker) { build(:custom_issue_tracker_integration, project: project) }
context 'is present' do
it 'returns true' do
......
......@@ -10,7 +10,7 @@ RSpec.describe Integrations::BaseIssueTracker do
let(:service) { Integrations::Redmine.new(project: project, active: true, issue_tracker_data: build(:issue_tracker_data)) }
before do
create(:custom_issue_tracker_service, project: project)
create(:custom_issue_tracker_integration, project: project)
end
context 'when service is changed manually by user' do
......
......@@ -63,7 +63,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:jira_service) }
it { is_expected.to have_one(:redmine_service) }
it { is_expected.to have_one(:youtrack_service) }
it { is_expected.to have_one(:custom_issue_tracker_service) }
it { is_expected.to have_one(:custom_issue_tracker_integration) }
it { is_expected.to have_one(:bugzilla_integration) }
it { is_expected.to have_one(:ewm_service) }
it { is_expected.to have_one(:external_wiki_service) }
......@@ -5311,7 +5311,7 @@ RSpec.describe Project, factory_default: :keep do
it { expect(project.has_active_services?).to be_falsey }
it 'returns true when a matching service exists' do
create(:custom_issue_tracker_service, push_events: true, merge_requests_events: false, project: project)
create(:custom_issue_tracker_integration, push_events: true, merge_requests_events: false, project: project)
expect(project.has_active_services?(:merge_request_hooks)).to be_falsey
expect(project.has_active_services?).to be_truthy
......
......@@ -26,7 +26,7 @@ RSpec.describe API::Services do
context 'project with services' do
let!(:active_service) { create(:emails_on_push_service, project: project, active: true) }
let!(:service) { create(:custom_issue_tracker_service, project: project, active: false) }
let!(:service) { create(:custom_issue_tracker_integration, project: project, active: false) }
it "returns a list of all active services" do
get api("/projects/#{project.id}/services", user)
......
......@@ -288,7 +288,7 @@ RSpec.describe 'layouts/nav/sidebar/_project' do
let(:external_issue_tracker_url) { 'http://test.com' }
let!(:external_issue_tracker) do
create(:custom_issue_tracker_service, active: external_issue_tracker_active, project: project, project_url: external_issue_tracker_url)
create(:custom_issue_tracker_integration, active: external_issue_tracker_active, project: project, project_url: external_issue_tracker_url)
end
context 'when external issue tracker is configured and active' do
......
......@@ -375,7 +375,7 @@ RSpec.describe PostReceive do
it 'asks the project to trigger all hooks' do
create(:project_hook, push_events: true, tag_push_events: true, project: project)
create(:custom_issue_tracker_service, push_events: true, merge_requests_events: false, project: project)
create(:custom_issue_tracker_integration, push_events: true, merge_requests_events: false, project: project)
allow(Project).to receive(:find_by).and_return(project)
expect(project).to receive(:execute_hooks).twice
......
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