Commit 150dc86e authored by Alex Kalderimis's avatar Alex Kalderimis

Rename youtrack integration

Renames project association from youtrack_service to
youtrack_integration.
parent f62a8657
...@@ -56,6 +56,7 @@ class Integration < ApplicationRecord ...@@ -56,6 +56,7 @@ class Integration < ApplicationRecord
teamcity teamcity
unify_circuit unify_circuit
webex_teams webex_teams
youtrack
].to_set.freeze ].to_set.freeze
def self.renamed?(name) def self.renamed?(name)
......
...@@ -190,7 +190,7 @@ class Project < ApplicationRecord ...@@ -190,7 +190,7 @@ class Project < ApplicationRecord
has_one :teamcity_integration, class_name: 'Integrations::Teamcity' has_one :teamcity_integration, class_name: 'Integrations::Teamcity'
has_one :unify_circuit_integration, class_name: 'Integrations::UnifyCircuit' has_one :unify_circuit_integration, class_name: 'Integrations::UnifyCircuit'
has_one :webex_teams_integration, class_name: 'Integrations::WebexTeams' has_one :webex_teams_integration, class_name: 'Integrations::WebexTeams'
has_one :youtrack_service, class_name: 'Integrations::Youtrack' has_one :youtrack_integration, class_name: 'Integrations::Youtrack'
has_one :root_of_fork_network, has_one :root_of_fork_network,
foreign_key: 'root_project_id', foreign_key: 'root_project_id',
......
...@@ -97,7 +97,7 @@ FactoryBot.define do ...@@ -97,7 +97,7 @@ FactoryBot.define do
issue_tracker issue_tracker
end end
factory :youtrack_service, class: 'Integrations::Youtrack' do factory :youtrack_integration, class: 'Integrations::Youtrack' do
project project
active { true } active { true }
issue_tracker issue_tracker
......
...@@ -402,7 +402,7 @@ FactoryBot.define do ...@@ -402,7 +402,7 @@ FactoryBot.define do
factory :youtrack_project, parent: :project do factory :youtrack_project, parent: :project do
has_external_issue_tracker { true } has_external_issue_tracker { true }
youtrack_service youtrack_integration
end end
factory :jira_project, parent: :project do factory :jira_project, parent: :project do
......
...@@ -140,7 +140,9 @@ RSpec.describe Banzai::Filter::References::ExternalIssueReferenceFilter do ...@@ -140,7 +140,9 @@ RSpec.describe Banzai::Filter::References::ExternalIssueReferenceFilter do
end end
context "youtrack project" do context "youtrack project" do
let_it_be(:service) { create(:youtrack_service, project: project) } before_all do
create(:youtrack_integration, project: project)
end
before do before do
project.update!(issues_enabled: false) project.update!(issues_enabled: false)
......
...@@ -388,7 +388,7 @@ project: ...@@ -388,7 +388,7 @@ project:
- pushover_integration - pushover_integration
- jira_integration - jira_integration
- redmine_integration - redmine_integration
- youtrack_service - youtrack_integration
- custom_issue_tracker_integration - custom_issue_tracker_integration
- bugzilla_integration - bugzilla_integration
- ewm_integration - ewm_integration
......
...@@ -26,11 +26,11 @@ RSpec.describe MigrateIssueTrackersData do ...@@ -26,11 +26,11 @@ RSpec.describe MigrateIssueTrackersData do
services.create!(type: 'BugzillaService', properties: properties, category: 'issue_tracker') services.create!(type: 'BugzillaService', properties: properties, category: 'issue_tracker')
end end
let!(:youtrack_service) do let!(:youtrack_integration) do
services.create!(type: 'YoutrackService', properties: properties, category: 'issue_tracker') services.create!(type: 'YoutrackService', properties: properties, category: 'issue_tracker')
end end
let!(:youtrack_service_empty) do let!(:youtrack_integration_empty) do
services.create!(type: 'YoutrackService', properties: '', category: 'issue_tracker') services.create!(type: 'YoutrackService', properties: '', category: 'issue_tracker')
end end
...@@ -56,7 +56,7 @@ RSpec.describe MigrateIssueTrackersData do ...@@ -56,7 +56,7 @@ RSpec.describe MigrateIssueTrackersData do
migrate! migrate!
expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_integration.id, bugzilla_integration.id) expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_integration.id, bugzilla_integration.id)
expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_service.id, gitlab_service.id) expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_integration.id, gitlab_service.id)
expect(BackgroundMigrationWorker.jobs.size).to eq(2) expect(BackgroundMigrationWorker.jobs.size).to eq(2)
end end
end end
......
...@@ -26,11 +26,11 @@ RSpec.describe RescheduleMigrateIssueTrackersData do ...@@ -26,11 +26,11 @@ RSpec.describe RescheduleMigrateIssueTrackersData do
services.create!(id: 12, type: 'BugzillaService', properties: properties, category: 'issue_tracker') services.create!(id: 12, type: 'BugzillaService', properties: properties, category: 'issue_tracker')
end end
let!(:youtrack_service) do let!(:youtrack_integration) do
services.create!(id: 13, type: 'YoutrackService', properties: properties, category: 'issue_tracker') services.create!(id: 13, type: 'YoutrackService', properties: properties, category: 'issue_tracker')
end end
let!(:youtrack_service_empty) do let!(:youtrack_integration_empty) do
services.create!(id: 14, type: 'YoutrackService', properties: '', category: 'issue_tracker') services.create!(id: 14, type: 'YoutrackService', properties: '', category: 'issue_tracker')
end end
...@@ -57,7 +57,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do ...@@ -57,7 +57,7 @@ RSpec.describe RescheduleMigrateIssueTrackersData do
migrate! migrate!
expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_integration.id, bugzilla_integration.id) expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_integration.id, bugzilla_integration.id)
expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_service.id, gitlab_service.id) expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_integration.id, gitlab_service.id)
expect(BackgroundMigrationWorker.jobs.size).to eq(2) expect(BackgroundMigrationWorker.jobs.size).to eq(2)
end end
end end
......
...@@ -62,7 +62,7 @@ RSpec.describe Project, factory_default: :keep do ...@@ -62,7 +62,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_one(:teamcity_integration) } it { is_expected.to have_one(:teamcity_integration) }
it { is_expected.to have_one(:jira_integration) } it { is_expected.to have_one(:jira_integration) }
it { is_expected.to have_one(:redmine_integration) } it { is_expected.to have_one(:redmine_integration) }
it { is_expected.to have_one(:youtrack_service) } it { is_expected.to have_one(:youtrack_integration) }
it { is_expected.to have_one(:custom_issue_tracker_integration) } 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_integration) } it { is_expected.to have_one(:ewm_integration) }
......
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