diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-20 21:11:53 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2016-12-20 21:11:53 +0300 |
commit | 61d09a7b15ef9ae2e23359f1afb87b0adbda4dd4 (patch) | |
tree | 1cfeb2ebdd16c9972ad296416a4db48c30cc7637 /spec/lib/mattermost/command_spec.rb | |
parent | 0cf23fde7c666b64e6c18a92d29e632f51b00059 (diff) |
WIP
Diffstat (limited to 'spec/lib/mattermost/command_spec.rb')
-rw-r--r-- | spec/lib/mattermost/command_spec.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/spec/lib/mattermost/command_spec.rb b/spec/lib/mattermost/command_spec.rb index f38bb273e7d..ecf336e3199 100644 --- a/spec/lib/mattermost/command_spec.rb +++ b/spec/lib/mattermost/command_spec.rb @@ -1,19 +1,17 @@ require 'spec_helper' describe Mattermost::Command do - let(:session) { double("session") } let(:hash) { { 'token' => 'token' } } + let(:user) { create(:user) } - describe '.create' do - before do - allow(session).to receive(:post).and_return(hash) - allow(hash).to receive(:parsed_response).and_return(hash) - end - - it 'gets the teams' do - expect(session).to receive(:post) + before do + Mattermost::Session.base_uri("http://mattermost.example.com") + end - described_class.create(session, 'abc', url: 'http://trigger.com') + describe '#create' do + it 'creates a command' do + described_class.new(user). + create(team_id: 'abc', url: 'http://trigger.com') end end end |