summaryrefslogtreecommitdiff
path: root/spec/services/groups
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/groups')
-rw-r--r--spec/services/groups/create_service_spec.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/services/groups/create_service_spec.rb b/spec/services/groups/create_service_spec.rb
index 235fa5c5188..d8181f73110 100644
--- a/spec/services/groups/create_service_spec.rb
+++ b/spec/services/groups/create_service_spec.rb
@@ -43,10 +43,17 @@ describe Groups::CreateService, '#execute', services: true 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)
+ it 'triggers the service' do
+ expect_any_instance_of(Mattermost::CreateTeamService).to receive(:execute)
subject
end
+
+ it 'create the chat team with the group' do
+ allow_any_instance_of(Mattermost::Team).to receive(:create)
+ .and_return({ 'name' => 'tanuki', 'id' => 'lskdjfwlekfjsdifjj' })
+
+ expect { subject }.to change { ChatTeam.count }.from(0).to(1)
+ end
end
end