Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
2393d30d
Commit
2393d30d
authored
Dec 20, 2016
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubocop errors [ci skip]
parent
e9c14918
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
8 deletions
+7
-8
app/models/project_services/mattermost_slash_commands_service.rb
...els/project_services/mattermost_slash_commands_service.rb
+3
-3
lib/mattermost/client.rb
lib/mattermost/client.rb
+1
-1
spec/features/projects/services/mattermost_slash_command_spec.rb
...atures/projects/services/mattermost_slash_command_spec.rb
+0
-1
spec/models/project_services/mattermost_slash_commands_service_spec.rb
...roject_services/mattermost_slash_commands_service_spec.rb
+3
-3
No files found.
app/models/project_services/mattermost_slash_commands_service.rb
View file @
2393d30d
...
@@ -24,13 +24,13 @@ class MattermostSlashCommandsService < ChatSlashCommandsService
...
@@ -24,13 +24,13 @@ class MattermostSlashCommandsService < ChatSlashCommandsService
create
(
command
(
params
))
create
(
command
(
params
))
update
(
active:
true
,
token:
token
)
if
token
update
(
active:
true
,
token:
token
)
if
token
rescue
=>
Mattermost
::
Error
=>
e
rescue
Mattermost
::
Error
=>
e
false
,
e
.
message
[
false
,
e
.
message
]
end
end
def
list_teams
(
user
)
def
list_teams
(
user
)
Mattermost
::
Team
.
new
(
user
).
all
Mattermost
::
Team
.
new
(
user
).
all
rescue
=>
Mattermost
::
Error
=>
e
rescue
Mattermost
::
Error
[]
[]
end
end
...
...
lib/mattermost/client.rb
View file @
2393d30d
...
@@ -34,7 +34,7 @@ module Mattermost
...
@@ -34,7 +34,7 @@ module Mattermost
end
end
json_response
json_response
rescue
JSON
::
JSONError
=>
e
rescue
JSON
::
JSONError
raise
ClientError
(
'Cannot parse response'
)
raise
ClientError
(
'Cannot parse response'
)
end
end
end
end
...
...
spec/features/projects/services/mattermost_slash_command_spec.rb
View file @
2393d30d
...
@@ -41,7 +41,6 @@ feature 'Setup Mattermost slash commands', feature: true do
...
@@ -41,7 +41,6 @@ feature 'Setup Mattermost slash commands', feature: true do
end
end
end
end
describe
'mattermost service is not enabled'
do
describe
'mattermost service is not enabled'
do
before
do
before
do
allow
(
Gitlab
.
config
.
mattermost
).
to
receive
(
:enabled
).
and_return
(
false
)
allow
(
Gitlab
.
config
.
mattermost
).
to
receive
(
:enabled
).
and_return
(
false
)
...
...
spec/models/project_services/mattermost_slash_commands_service_spec.rb
View file @
2393d30d
...
@@ -10,13 +10,13 @@ describe MattermostSlashCommandsService, :models do
...
@@ -10,13 +10,13 @@ describe MattermostSlashCommandsService, :models do
before
do
before
do
allow_any_instance_of
(
Mattermost
::
Session
).
to
allow_any_instance_of
(
Mattermost
::
Session
).
to
receive
(
:with_session
).
and_yield
receive
(
:with_session
).
and_yield
end
end
subject
do
subject
do
service
.
configure!
(
user
,
team_id:
'abc'
,
service
.
configure!
(
user
,
team_id:
'abc'
,
trigger:
'gitlab'
,
url:
'http://trigger.url'
,
trigger:
'gitlab'
,
url:
'http://trigger.url'
,
icon_url:
'http://icon.url/icon.png'
)
icon_url:
'http://icon.url/icon.png'
)
end
end
context
'the requests succeeds'
do
context
'the requests succeeds'
do
...
...
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