Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/mattermost/command_spec.rb')
-rw-r--r--spec/lib/mattermost/command_spec.rb15
1 files changed, 10 insertions, 5 deletions
diff --git a/spec/lib/mattermost/command_spec.rb b/spec/lib/mattermost/command_spec.rb
index ecf336e3199..f70aee7f3e5 100644
--- a/spec/lib/mattermost/command_spec.rb
+++ b/spec/lib/mattermost/command_spec.rb
@@ -1,17 +1,22 @@
require 'spec_helper'
describe Mattermost::Command do
- let(:hash) { { 'token' => 'token' } }
- let(:user) { create(:user) }
+ let(:params) { { 'token' => 'token', team_id: 'abc' } }
+ let(:user) { build(:user) }
before do
Mattermost::Session.base_uri("http://mattermost.example.com")
end
+ subject { described_class.new(user) }
+
describe '#create' do
- it 'creates a command' do
- described_class.new(user).
- create(team_id: 'abc', url: 'http://trigger.com')
+ it 'interpolates the team id' do
+ allow(subject).to receive(:json_post).
+ with('/api/v3/teams/abc/commands/create', body: params.to_json).
+ and_return('token' => 'token')
+
+ subject.create(params)
end
end
end