Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBoyan Tabakov <boyan.tabakov@futurice.com>2015-08-14 16:31:11 +0300
committerBoyan Tabakov <boyan.tabakov@futurice.com>2015-08-14 17:45:23 +0300
commit88ab815b3844ce5c611d0ee5a1e8aaacb6c92faa (patch)
tree073f602bcad00cd1b26a03c236819010ce3d1a12 /spec
parentb6bdd650a54306c3f56f8332a64a3f5194ee793d (diff)
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')
-rw-r--r--spec/models/project_services/flowdock_service_spec.rb12
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