From b38a3485f0f6f08ce43bdf372a436ae5d73c329c Mon Sep 17 00:00:00 2001 From: Kukovskii Vladimir Date: Wed, 18 Jul 2018 20:14:55 +0900 Subject: Fix Hangouts Chat service spec shared example --- spec/models/project_services/hangouts_chat_service_spec.rb | 12 ++++-------- 1 file 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') -- cgit v1.2.1