summaryrefslogtreecommitdiff
path: root/spec/lib/mattermost
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/mattermost')
-rw-r--r--spec/lib/mattermost/command_spec.rb18
-rw-r--r--spec/lib/mattermost/team_spec.rb2
2 files changed, 9 insertions, 11 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
diff --git a/spec/lib/mattermost/team_spec.rb b/spec/lib/mattermost/team_spec.rb
index c208be3912b..5d1fc6fc603 100644
--- a/spec/lib/mattermost/team_spec.rb
+++ b/spec/lib/mattermost/team_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe Mattermost::Team do
- describe '.team_admin' do
+ describe '#all' do
let(:session) { double("session") }
let(:response) do