diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-05-30 11:58:53 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-05-30 11:58:53 +0300 |
commit | b2d8d161a060f9e257845ae5813395761132cb13 (patch) | |
tree | e24c7ed30cfd63890422297557245abc1dae5161 /spec/models | |
parent | 63d7408125ddbe366bfe468fa4a2f9637acf930b (diff) | |
parent | ef5e13c946446441d767e9aa3834afff29277f96 (diff) |
Merge branch 'mattermost-api-v4' into 'master'
Updated Mattermost integration to use Mattermost API v4
Closes #41631
See merge request gitlab-org/gitlab-ce!19043
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_services/mattermost_slash_commands_service_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/project_services/mattermost_slash_commands_service_spec.rb b/spec/models/project_services/mattermost_slash_commands_service_spec.rb index 05d33cd3874..1983e0cc967 100644 --- a/spec/models/project_services/mattermost_slash_commands_service_spec.rb +++ b/spec/models/project_services/mattermost_slash_commands_service_spec.rb @@ -25,7 +25,7 @@ describe MattermostSlashCommandsService do context 'the requests succeeds' do before do - stub_request(:post, 'http://mattermost.example.com/api/v3/teams/abc/commands/create') + stub_request(:post, 'http://mattermost.example.com/api/v4/commands') .with(body: { team_id: 'abc', trigger: 'gitlab', @@ -59,7 +59,7 @@ describe MattermostSlashCommandsService do context 'an error is received' do before do - stub_request(:post, 'http://mattermost.example.com/api/v3/teams/abc/commands/create') + stub_request(:post, 'http://mattermost.example.com/api/v4/commands') .to_return( status: 500, headers: { 'Content-Type' => 'application/json' }, @@ -89,11 +89,11 @@ describe MattermostSlashCommandsService do context 'the requests succeeds' do before do - stub_request(:get, 'http://mattermost.example.com/api/v3/teams/all') + stub_request(:get, 'http://mattermost.example.com/api/v4/users/me/teams') .to_return( status: 200, headers: { 'Content-Type' => 'application/json' }, - body: { 'list' => true }.to_json + body: [{ id: 'test_team_id' }].to_json ) end @@ -104,7 +104,7 @@ describe MattermostSlashCommandsService do context 'an error is received' do before do - stub_request(:get, 'http://mattermost.example.com/api/v3/teams/all') + stub_request(:get, 'http://mattermost.example.com/api/v4/users/me/teams') .to_return( status: 500, headers: { 'Content-Type' => 'application/json' }, |