diff options
author | Rémy Coutable <remy@rymai.me> | 2017-11-09 13:19:27 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-11-09 13:19:27 +0000 |
commit | ae434cccb2de4dacd5741b334869b7ee2d41849e (patch) | |
tree | 26a448ad57cd9a12cd98ead5741657c45e43c6fa /spec/requests | |
parent | 43d98cd1ff3ea0dd6a794ba4d1d621415d439985 (diff) | |
parent | 12d622eb996b6499e5fbd2be01cca27c08a976fa (diff) | |
download | gitlab-ce-ae434cccb2de4dacd5741b334869b7ee2d41849e.tar.gz |
Merge branch '39895-cant-set-mattermost-username-channel-from-api' into 'master'
Fix acceptance of username for Mattermost service update
Closes #39895
See merge request gitlab-org/gitlab-ce!15275
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/services_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/requests/api/services_spec.rb b/spec/requests/api/services_spec.rb index dfe48e45d49..ba697e2b305 100644 --- a/spec/requests/api/services_spec.rb +++ b/spec/requests/api/services_spec.rb @@ -175,4 +175,25 @@ describe API::Services do end end end + + describe 'Mattermost service' do + let(:service_name) { 'mattermost' } + let(:params) do + { webhook: 'https://hook.example.com', username: 'username' } + end + + before do + project.create_mattermost_service( + active: true, + properties: params + ) + end + + it 'accepts a username for update' do + put api("/projects/#{project.id}/services/mattermost", user), params.merge(username: 'new_username') + + expect(response).to have_gitlab_http_status(200) + expect(json_response['properties']['username']).to eq('new_username') + end + end end |