diff options
Diffstat (limited to 'spec/migrations/delete_template_services_duplicated_by_type_spec.rb')
-rw-r--r-- | spec/migrations/delete_template_services_duplicated_by_type_spec.rb | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/spec/migrations/delete_template_services_duplicated_by_type_spec.rb b/spec/migrations/delete_template_services_duplicated_by_type_spec.rb deleted file mode 100644 index 577fea984da..00000000000 --- a/spec/migrations/delete_template_services_duplicated_by_type_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe DeleteTemplateServicesDuplicatedByType do - let(:services) { table(:services) } - - before do - services.create!(template: true, type: 'JenkinsService') - services.create!(template: true, type: 'JenkinsService') - services.create!(template: true, type: 'JiraService') - services.create!(template: true, type: 'JenkinsService') - end - - it 'deletes service templates duplicated by type except the one with the lowest ID' do - jenkins_integration_id = services.where(type: 'JenkinsService').order(:id).pluck(:id).first - jira_integration_id = services.where(type: 'JiraService').pluck(:id).first - - migrate! - - expect(services.pluck(:id)).to contain_exactly(jenkins_integration_id, jira_integration_id) - end -end |