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/team_spec.rb | |
parent | 0bd8669f3a606479e3f97683e0bfb178856df422 (diff) |
Fix rspec tests due to different API
[ci skip]
Diffstat (limited to 'spec/lib/mattermost/team_spec.rb')
-rw-r--r-- | spec/lib/mattermost/team_spec.rb | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/spec/lib/mattermost/team_spec.rb b/spec/lib/mattermost/team_spec.rb index 5d1fc6fc603..ef39c456d5f 100644 --- a/spec/lib/mattermost/team_spec.rb +++ b/spec/lib/mattermost/team_spec.rb @@ -2,7 +2,9 @@ require 'spec_helper' describe Mattermost::Team do describe '#all' do - let(:session) { double("session") } + let(:user) { build(:user) } + + subject { described_class.new(user) } let(:response) do [{ @@ -20,22 +22,13 @@ describe Mattermost::Team do "allow_open_invite" => false }] end - let(:json) { nil } before do - allow(session).to receive(:get).with('/api/v3/teams/all'). - and_return(json) - allow(json).to receive(:parsed_response).and_return(response) + allow(subject).to receive(:json_get).and_return(response) end it 'gets the teams' do - expect(described_class.all(session).count).to be(1) - end - - it 'filters on being team admin' do - ids = described_class.all(session).map { |team| team['id'] } - - expect(ids).to include("xiyro8huptfhdndadpz8r3wnbo") + expect(subject.all.count).to be(1) end end end |