summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/models/project_services/hangouts_chat_service_spec.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/spec/models/project_services/hangouts_chat_service_spec.rb b/spec/models/project_services/hangouts_chat_service_spec.rb
index 8a1c4e33204..cfa55188a64 100644
--- a/spec/models/project_services/hangouts_chat_service_spec.rb
+++ b/spec/models/project_services/hangouts_chat_service_spec.rb
@@ -45,7 +45,10 @@ describe HangoutsChatService do
it 'calls Hangouts Chat API' do
subject.execute(sample_data)
- expect(WebMock).to have_requested(:post, webhook_url).once
+ expect(WebMock)
+ .to have_requested(:post, webhook_url)
+ .with { |req| req.body =~ /\A{"text":.+}\Z/ }
+ .once
end
end
@@ -62,13 +65,6 @@ describe HangoutsChatService do
subject.execute(sample_data)
end
- it 'sends the simple text message to the Hangouts Chat API' do
- subject.execute(sample_data)
-
- expect(WebMock).to have_requested(:post, webhook_url).once
- .with { |req| req.body =~ /\A{"text":.+}\Z/ }
- end
-
context 'with not default branch' do
let(:sample_data) do
Gitlab::DataBuilder::Push.build(project, user, nil, nil, 'not-the-default-branch')