summaryrefslogtreecommitdiff
path: root/spec/lib/mattermost/command_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/mattermost/command_spec.rb')
-rw-r--r--spec/lib/mattermost/command_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/lib/mattermost/command_spec.rb b/spec/lib/mattermost/command_spec.rb
index 8ba15ae0f38..7c194749dfb 100644
--- a/spec/lib/mattermost/command_spec.rb
+++ b/spec/lib/mattermost/command_spec.rb
@@ -21,13 +21,13 @@ describe Mattermost::Command do
context 'for valid trigger word' 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'
}.to_json)
.to_return(
- status: 200,
+ status: 201,
headers: { 'Content-Type' => 'application/json' },
body: { token: 'token' }.to_json
)
@@ -40,16 +40,16 @@ describe Mattermost::Command do
context 'for error message' 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,
+ status: 400,
headers: { 'Content-Type' => 'application/json' },
body: {
id: 'api.command.duplicate_trigger.app_error',
message: 'This trigger word is already in use. Please choose another word.',
detailed_error: '',
request_id: 'obc374man7bx5r3dbc1q5qhf3r',
- status_code: 500
+ status_code: 400
}.to_json
)
end