diff options
author | Boyan Tabakov <boyan.tabakov@futurice.com> | 2015-08-14 15:31:11 +0200 |
---|---|---|
committer | Boyan Tabakov <boyan.tabakov@futurice.com> | 2015-08-14 16:45:23 +0200 |
commit | 88ab815b3844ce5c611d0ee5a1e8aaacb6c92faa (patch) | |
tree | 073f602bcad00cd1b26a03c236819010ce3d1a12 /spec/models | |
parent | b6bdd650a54306c3f56f8332a64a3f5194ee793d (diff) | |
download | gitlab-ce-88ab815b3844ce5c611d0ee5a1e8aaacb6c92faa.tar.gz |
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.
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_services/flowdock_service_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
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 |