blob: 0fe6163900dde963a1bef2ba9679caf4724d0983 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
require 'spec_helper'
describe Mattermost::Team do
describe '.team_admin' do
let(:init_load) do
JSON.parse(File.read(Rails.root.join('spec/fixtures/', 'mattermost_initial_load.json')))
end
before do
allow(described_class).to receive(:initial_load).and_return(init_load)
end
it 'gets the teams' do
expect(described_class.team_admin.count).to be(2)
end
it 'filters on being team admin' do
ids = described_class.team_admin.map { |team| team['id'] }
expect(ids).to include("w59qt5a817f69jkxdz6xe7y4ir", "my9oujxf5jy1zqdgu9rihd66do")
end
end
end
|