Commit 921f411a authored by Z.J. van de Weg's avatar Z.J. van de Weg

Last fixes

parent 5c99afcf
......@@ -37,7 +37,7 @@ class MattermostSlashCommandsService < ChatService
end
end
def list_teams
def list_teams(current_user)
begin
response = Mattermost::Session.new(current_user).with_session do |session|
Mattermost::Team.all(session)
......
module Mattermost
class Team
def self.all(session)
retreive_teams(session)
end
def self.retreive_teams(session)
session.get('/api/v3/teams/all').parsed_response
end
end
......
......@@ -6,18 +6,18 @@ describe Mattermost::Team do
let(:response) do
[{
"id"=>"xiyro8huptfhdndadpz8r3wnbo",
"create_at"=>1482174222155,
"update_at"=>1482174222155,
"delete_at"=>0,
"display_name"=>"chatops",
"name"=>"chatops",
"email"=>"admin@example.com",
"type"=>"O",
"company_name"=>"",
"allowed_domains"=>"",
"invite_id"=>"o4utakb9jtb7imctdfzbf9r5ro",
"allow_open_invite"=>false}]
"id" => "xiyro8huptfhdndadpz8r3wnbo",
"create_at" => 1482174222155,
"update_at" => 1482174222155,
"delete_at" => 0,
"display_name" => "chatops",
"name" => "chatops",
"email" => "admin@example.com",
"type" => "O",
"company_name" => "",
"allowed_domains" => "",
"invite_id" => "o4utakb9jtb7imctdfzbf9r5ro",
"allow_open_invite" => false }]
end
let(:json) { nil }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment