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
921f411a
Commit
921f411a
authored
Dec 19, 2016
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Last fixes
parent
5c99afcf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
17 deletions
+13
-17
app/models/project_services/mattermost_slash_commands_service.rb
...els/project_services/mattermost_slash_commands_service.rb
+1
-1
lib/mattermost/team.rb
lib/mattermost/team.rb
+0
-4
spec/lib/mattermost/team_spec.rb
spec/lib/mattermost/team_spec.rb
+12
-12
No files found.
app/models/project_services/mattermost_slash_commands_service.rb
View file @
921f411a
...
@@ -37,7 +37,7 @@ class MattermostSlashCommandsService < ChatService
...
@@ -37,7 +37,7 @@ class MattermostSlashCommandsService < ChatService
end
end
end
end
def
list_teams
def
list_teams
(
current_user
)
begin
begin
response
=
Mattermost
::
Session
.
new
(
current_user
).
with_session
do
|
session
|
response
=
Mattermost
::
Session
.
new
(
current_user
).
with_session
do
|
session
|
Mattermost
::
Team
.
all
(
session
)
Mattermost
::
Team
.
all
(
session
)
...
...
lib/mattermost/team.rb
View file @
921f411a
module
Mattermost
module
Mattermost
class
Team
class
Team
def
self
.
all
(
session
)
def
self
.
all
(
session
)
retreive_teams
(
session
)
end
def
self
.
retreive_teams
(
session
)
session
.
get
(
'/api/v3/teams/all'
).
parsed_response
session
.
get
(
'/api/v3/teams/all'
).
parsed_response
end
end
end
end
...
...
spec/lib/mattermost/team_spec.rb
View file @
921f411a
...
@@ -6,18 +6,18 @@ describe Mattermost::Team do
...
@@ -6,18 +6,18 @@ describe Mattermost::Team do
let
(
:response
)
do
let
(
:response
)
do
[{
[{
"id"
=>
"xiyro8huptfhdndadpz8r3wnbo"
,
"id"
=>
"xiyro8huptfhdndadpz8r3wnbo"
,
"create_at"
=>
1482174222155
,
"create_at"
=>
1482174222155
,
"update_at"
=>
1482174222155
,
"update_at"
=>
1482174222155
,
"delete_at"
=>
0
,
"delete_at"
=>
0
,
"display_name"
=>
"chatops"
,
"display_name"
=>
"chatops"
,
"name"
=>
"chatops"
,
"name"
=>
"chatops"
,
"email"
=>
"admin@example.com"
,
"email"
=>
"admin@example.com"
,
"type"
=>
"O"
,
"type"
=>
"O"
,
"company_name"
=>
""
,
"company_name"
=>
""
,
"allowed_domains"
=>
""
,
"allowed_domains"
=>
""
,
"invite_id"
=>
"o4utakb9jtb7imctdfzbf9r5ro"
,
"invite_id"
=>
"o4utakb9jtb7imctdfzbf9r5ro"
,
"allow_open_invite"
=>
false
}]
"allow_open_invite"
=>
false
}]
end
end
let
(
:json
)
{
nil
}
let
(
:json
)
{
nil
}
...
...
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