BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
12d622eb
Commit
12d622eb
authored
Nov 08, 2017
by
Mark Fletcher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix acceptance of username for Mattermost service update via API
parent
0c3877a4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
1 deletion
+33
-1
39895-cant-set-mattermost-username-channel-from-api.yml
...d/39895-cant-set-mattermost-username-channel-from-api.yml
+5
-0
services.md
doc/api/services.md
+1
-1
services.rb
lib/api/services.rb
+6
-0
services_spec.rb
spec/requests/api/services_spec.rb
+21
-0
No files found.
changelogs/unreleased/39895-cant-set-mattermost-username-channel-from-api.yml
0 → 100644
View file @
12d622eb
---
title
:
Fix acceptance of username for Mattermost service update
merge_request
:
15275
author
:
type
:
fixed
doc/api/services.md
View file @
12d622eb
...
...
@@ -572,7 +572,7 @@ Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
|
`token`
| string | yes | The Mattermost token |
|
`username`
| string | no | The username to use to post the message |
### Delete Mattermost slash command service
...
...
lib/api/services.rb
View file @
12d622eb
...
...
@@ -522,6 +522,12 @@ module API
name: :webhook
,
type:
String
,
desc:
'The Mattermost webhook. e.g. http://mattermost_host/hooks/...'
},
{
required:
false
,
name: :username
,
type:
String
,
desc:
'The username to use to post the message'
}
],
'teamcity'
=>
[
...
...
spec/requests/api/services_spec.rb
View file @
12d622eb
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment