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 ...@@ -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)
......
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
......
...@@ -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 }
......
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