Commit 64f4175e authored by Justin Ho Tuan Duong's avatar Justin Ho Tuan Duong Committed by Igor Drozdov

Fix order of integrations to be sorted alphabetically

Integrations were previously sorted by SERVICE_NAMES
in service.rb which causes the gitlab_slack_application to
appear in the wrong order even though its title starts with
"S" since the old sort uses "G".
parent df51e59c
......@@ -1253,7 +1253,7 @@ class Project < ApplicationRecord
available_services_names.map do |service_name|
find_or_initialize_service(service_name)
end
end.sort_by(&:title)
end
def disabled_services
......
---
title: Fix order of integrations to be sorted alphabetically
merge_request: 34501
author:
type: fixed
......@@ -5227,13 +5227,13 @@ describe Project do
describe '#find_or_initialize_services' do
it 'returns only enabled services' do
allow(Service).to receive(:available_services_names).and_return(%w[prometheus pushover])
allow(Service).to receive(:available_services_names).and_return(%w[prometheus pushover teamcity])
allow(subject).to receive(:disabled_services).and_return(%w[prometheus])
services = subject.find_or_initialize_services
expect(services.count).to eq 1
expect(services).to include(PushoverService)
expect(services.count).to eq(2)
expect(services.map(&:title)).to eq(['JetBrains TeamCity CI', 'Pushover'])
end
end
......
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