summaryrefslogtreecommitdiff
path: root/spec/models/project_services/mattermost_slash_commands_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/project_services/mattermost_slash_commands_service_spec.rb')
-rw-r--r--spec/models/project_services/mattermost_slash_commands_service_spec.rb10
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' },