diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-12-20 22:56:46 +0300 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2016-12-20 22:57:09 +0300 |
commit | 4a03fae930a58b485ee610ce9e6058a2c2dd3d6e (patch) | |
tree | 418163b6578935b3660de4da67ab0e946f80acf6 /spec/lib/mattermost/command_spec.rb | |
parent | 0bd8669f3a606479e3f97683e0bfb178856df422 (diff) |
Fix rspec tests due to different API
[ci skip]
Diffstat (limited to 'spec/lib/mattermost/command_spec.rb')
-rw-r--r-- | spec/lib/mattermost/command_spec.rb | 15 |
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 |