summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-26 06:08:38 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-26 06:08:38 +0000
commitbbda97dde4df05f2aaccdf325a8344f36358ccde (patch)
tree6c0450201b3e25fc57abaedf596b569697f3d057 /spec
parent3e2ef953d9a22cb3139e7b395a1173604c563007 (diff)
downloadgitlab-ce-bbda97dde4df05f2aaccdf325a8344f36358ccde.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/services_spec.rb34
1 files changed, 33 insertions, 1 deletions
diff --git a/spec/requests/api/services_spec.rb b/spec/requests/api/services_spec.rb
index 08f58387bf8..5dc7de0ab8b 100644
--- a/spec/requests/api/services_spec.rb
+++ b/spec/requests/api/services_spec.rb
@@ -241,10 +241,42 @@ describe API::Services do
end
it 'accepts a username for update' do
- put api("/projects/#{project.id}/services/mattermost", user), params: params.merge(username: 'new_username')
+ put api("/projects/#{project.id}/services/#{service_name}", user), params: params.merge(username: 'new_username')
expect(response).to have_gitlab_http_status(200)
expect(json_response['properties']['username']).to eq('new_username')
end
end
+
+ describe 'Microsoft Teams service' do
+ let(:service_name) { 'microsoft-teams' }
+ let(:params) do
+ {
+ webhook: 'https://hook.example.com',
+ branches_to_be_notified: 'default',
+ notify_only_broken_pipelines: false
+ }
+ end
+
+ before do
+ project.create_microsoft_teams_service(
+ active: true,
+ properties: params
+ )
+ end
+
+ it 'accepts branches_to_be_notified for update' do
+ put api("/projects/#{project.id}/services/#{service_name}", user), params: params.merge(branches_to_be_notified: 'all')
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(json_response['properties']['branches_to_be_notified']).to eq('all')
+ end
+
+ it 'accepts notify_only_broken_pipelines for update' do
+ put api("/projects/#{project.id}/services/#{service_name}", user), params: params.merge(notify_only_broken_pipelines: true)
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(json_response['properties']['notify_only_broken_pipelines']).to eq(true)
+ end
+ end
end