From 88ab815b3844ce5c611d0ee5a1e8aaacb6c92faa Mon Sep 17 00:00:00 2001 From: Boyan Tabakov Date: Fri, 14 Aug 2015 15:31:11 +0200 Subject: Update Flowdock integration to support new Flowdock API Requires that users create a Git source in their flows and update the configured token to the Git source token. The old flow tokens can't be used. --- spec/models/project_services/flowdock_service_spec.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'spec') diff --git a/spec/models/project_services/flowdock_service_spec.rb b/spec/models/project_services/flowdock_service_spec.rb index 7e5b15cb09e..16296607a94 100644 --- a/spec/models/project_services/flowdock_service_spec.rb +++ b/spec/models/project_services/flowdock_service_spec.rb @@ -39,15 +39,19 @@ describe FlowdockService do token: 'verySecret' ) @sample_data = Gitlab::PushDataBuilder.build_sample(project, user) - @api_url = 'https://api.flowdock.com/v1/git/verySecret' + @api_url = 'https://api.flowdock.com/v1/messages' WebMock.stub_request(:post, @api_url) end it "should call FlowDock API" do @flowdock_service.execute(@sample_data) - expect(WebMock).to have_requested(:post, @api_url).with( - body: /#{@sample_data[:before]}.*#{@sample_data[:after]}.*#{project.path}/ - ).once + @sample_data[:commits].each do |commit| + # One request to Flowdock per new commit + next if commit[:id] == @sample_data[:before] + expect(WebMock).to have_requested(:post, @api_url).with( + body: /#{commit[:id]}.*#{project.path}/ + ).once + end end end end -- cgit v1.2.3