Commit 80c120dc authored by Alex Kalderimis's avatar Alex Kalderimis

Rename mattermost_service to mattermost_integration

This renames the mattermost project association from mattermost_service
to mattermost_integration
parent d2580206
......@@ -49,6 +49,7 @@ class Integration < ApplicationRecord
hangouts_chat
irker
packagist pipelines_email pivotaltracker pushover
mattermost
].to_set.freeze
def self.renamed?(name)
......
......@@ -174,7 +174,7 @@ class Project < ApplicationRecord
has_one :irker_integration, class_name: 'Integrations::Irker'
has_one :jenkins_service, class_name: 'Integrations::Jenkins'
has_one :jira_service, class_name: 'Integrations::Jira'
has_one :mattermost_service, class_name: 'Integrations::Mattermost'
has_one :mattermost_integration, class_name: 'Integrations::Mattermost'
has_one :mattermost_slash_commands_service, class_name: 'Integrations::MattermostSlashCommands'
has_one :microsoft_teams_service, class_name: 'Integrations::MicrosoftTeams'
has_one :mock_ci_service, class_name: 'Integrations::MockCi'
......
......@@ -379,7 +379,7 @@ project:
- asana_integration
- slack_service
- microsoft_teams_service
- mattermost_service
- mattermost_integration
- hangouts_chat_integration
- unify_circuit_service
- buildkite_integration
......
......@@ -37,7 +37,7 @@ RSpec.describe Project, factory_default: :keep do
it { is_expected.to have_many(:exported_protected_branches) }
it { is_expected.to have_one(:slack_service) }
it { is_expected.to have_one(:microsoft_teams_service) }
it { is_expected.to have_one(:mattermost_service) }
it { is_expected.to have_one(:mattermost_integration) }
it { is_expected.to have_one(:hangouts_chat_integration) }
it { is_expected.to have_one(:unify_circuit_service) }
it { is_expected.to have_one(:webex_teams_service) }
......
......@@ -254,21 +254,21 @@ RSpec.describe API::Services do
end
end
describe 'Mattermost service' do
let(:service_name) { 'mattermost' }
describe 'Mattermost integration' do
let(:integration_name) { 'mattermost' }
let(:params) do
{ webhook: 'https://hook.example.com', username: 'username' }
end
before do
project.create_mattermost_service(
project.create_mattermost_integration(
active: true,
properties: params
)
end
it 'accepts a username for update' do
put api("/projects/#{project.id}/services/#{service_name}", user), params: params.merge(username: 'new_username')
put api("/projects/#{project.id}/services/#{integration_name}", user), params: params.merge(username: 'new_username')
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['properties']['username']).to eq('new_username')
......
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