diff options
author | Mark Fletcher <mark@gitlab.com> | 2017-11-08 10:22:24 +0000 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2017-11-08 19:48:19 +0000 |
commit | 12d622eb996b6499e5fbd2be01cca27c08a976fa (patch) | |
tree | fa1f41c5afd88034c52e39f04bb947147ad269e7 /spec/requests | |
parent | 0c3877a48827b587b407174410196993bec79f73 (diff) | |
download | gitlab-ce-12d622eb996b6499e5fbd2be01cca27c08a976fa.tar.gz |
Fix acceptance of username for Mattermost service update via API
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 |