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
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-04-27 16:29:31 +0300
committerValery Sizov <vsv2711@gmail.com>2015-04-27 16:29:31 +0300
commitbc9ba5237cafd4b24405596f0c9e8af099635c29 (patch)
tree82ded5d3c0cbc39a9bfd0430684757d7309c9a88 /spec/models/hooks/web_hook_spec.rb
parentbb8c1cadf39415d2f916d135e8bbfdce49842f2f (diff)
Revert "Added X-GitLab-Event header for web hooks"
This reverts commit 548f182814acd0f7a110e6c165c186e345901b00.
Diffstat (limited to 'spec/models/hooks/web_hook_spec.rb')
-rw-r--r--spec/models/hooks/web_hook_spec.rb14
1 files changed, 5 insertions, 9 deletions
diff --git a/spec/models/hooks/web_hook_spec.rb b/spec/models/hooks/web_hook_spec.rb
index 14f873e6b5a..67ec9193ad7 100644
--- a/spec/models/hooks/web_hook_spec.rb
+++ b/spec/models/hooks/web_hook_spec.rb
@@ -52,26 +52,22 @@ describe ProjectHook do
end
it "POSTs to the web hook URL" do
- @project_hook.execute(@data, 'push_hooks')
- expect(WebMock).to have_requested(:post, @project_hook.url).
- with(headers: {'Content-Type'=>'application/json', 'X-Gitlab-Event'=>'Push Hook'}).
- once
+ @project_hook.execute(@data)
+ expect(WebMock).to have_requested(:post, @project_hook.url).once
end
it "POSTs the data as JSON" do
json = @data.to_json
- @project_hook.execute(@data, 'push_hooks')
- expect(WebMock).to have_requested(:post, @project_hook.url).
- with(headers: {'Content-Type'=>'application/json', 'X-Gitlab-Event'=>'Push Hook'}).
- once
+ @project_hook.execute(@data)
+ expect(WebMock).to have_requested(:post, @project_hook.url).with(body: json).once
end
it "catches exceptions" do
expect(WebHook).to receive(:post).and_raise("Some HTTP Post error")
expect {
- @project_hook.execute(@data, 'push_hooks')
+ @project_hook.execute(@data)
}.to raise_error
end
end