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