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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
7c5872c1
Commit
7c5872c1
authored
Feb 23, 2018
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose ChatName in GlobalSlackHandler
parent
36335ba9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
ee/app/services/slash_commands/global_slack_handler.rb
ee/app/services/slash_commands/global_slack_handler.rb
+3
-3
ee/spec/services/slash_commands/global_slack_handler_spec.rb
ee/spec/services/slash_commands/global_slack_handler_spec.rb
+2
-1
No files found.
ee/app/services/slash_commands/global_slack_handler.rb
View file @
7c5872c1
...
...
@@ -22,10 +22,10 @@ module SlashCommands
service
=
integration
.
service
project
=
service
.
project
user
=
ChatNames
::
FindUserService
.
new
(
service
,
params
).
execute
chat_
user
=
ChatNames
::
FindUserService
.
new
(
service
,
params
).
execute
if
user
Gitlab
::
SlashCommands
::
Command
.
new
(
project
,
user
,
params
).
execute
if
chat_user
&
.
user
Gitlab
::
SlashCommands
::
Command
.
new
(
project
,
chat_
user
,
params
).
execute
else
url
=
ChatNames
::
AuthorizeUserService
.
new
(
service
,
params
).
execute
Gitlab
::
SlashCommands
::
Presenters
::
Access
.
new
(
url
).
authorize
...
...
ee/spec/services/slash_commands/global_slack_handler_spec.rb
View file @
7c5872c1
...
...
@@ -3,6 +3,7 @@ require 'spec_helper'
describe
SlashCommands
::
GlobalSlackHandler
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:chat_name
)
{
double
(
:chat_name
,
user:
user
)
}
let
(
:verification_token
)
{
'123'
}
before
do
...
...
@@ -32,7 +33,7 @@ describe SlashCommands::GlobalSlackHandler do
context
'Valid token'
do
it
'calls command handler if project alias is valid'
do
expect_any_instance_of
(
Gitlab
::
SlashCommands
::
Command
).
to
receive
(
:execute
)
expect_any_instance_of
(
ChatNames
::
FindUserService
).
to
receive
(
:execute
).
and_return
(
user
)
expect_any_instance_of
(
ChatNames
::
FindUserService
).
to
receive
(
:execute
).
and_return
(
chat_name
)
enable_slack_application
(
project
)
...
...
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