diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-02-03 11:29:56 +0100 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-02-16 09:19:02 +0100 |
commit | 1a0e54b32d43e2a3de88c20037bd167b1f8563d6 (patch) | |
tree | 21b9a0fe8cc36425b105c5065ec951ea390a177e /spec/services | |
parent | 297dc70158f905fef4557d1ee6510bcf459a08a9 (diff) | |
download | gitlab-ce-1a0e54b32d43e2a3de88c20037bd167b1f8563d6.tar.gz |
Add tests for Mattermost team creation
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/groups/create_service_spec.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/services/groups/create_service_spec.rb b/spec/services/groups/create_service_spec.rb index 14717a7455d..235fa5c5188 100644 --- a/spec/services/groups/create_service_spec.rb +++ b/spec/services/groups/create_service_spec.rb @@ -4,11 +4,11 @@ describe Groups::CreateService, '#execute', services: true do let!(:user) { create(:user) } let!(:group_params) { { path: "group_path", visibility_level: Gitlab::VisibilityLevel::PUBLIC } } + subject { service.execute } + describe 'visibility level restrictions' do let!(:service) { described_class.new(user, group_params) } - subject { service.execute } - context "create groups without restricted visibility level" do it { is_expected.to be_persisted } end @@ -24,8 +24,6 @@ describe Groups::CreateService, '#execute', services: true do let!(:group) { create(:group) } let!(:service) { described_class.new(user, group_params.merge(parent_id: group.id)) } - subject { service.execute } - context 'as group owner' do before { group.add_owner(user) } @@ -40,4 +38,15 @@ describe Groups::CreateService, '#execute', services: true do end end end + + describe 'creating a mattermost team' do + let!(:params) { group_params.merge(create_chat_team: true) } + let!(:service) { described_class.new(user, params) } + + it 'queues a background job' do + expect(Mattermost::CreateTeamWorker).to receive(:perform_async) + + subject + end + end end |