forked from github/github-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbugherd_test.rb
More file actions
47 lines (39 loc) · 1.22 KB
/
Copy pathbugherd_test.rb
File metadata and controls
47 lines (39 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
require File.expand_path('../helper', __FILE__)
class BugHerdTest < Service::TestCase
def setup
@stubs = Faraday::Adapter::Test::Stubs.new
end
def test_push
@stubs.post "/github_web_hook/KEY" do |env|
assert_equal 'www.bugherd.com', env[:url].host
assert_equal 'application/x-www-form-urlencoded',
env[:request_headers]['content-type']
[200, {}, '']
end
svc = service :push, {'project_key' => 'KEY'}, payload
svc.receive_push
end
def test_issues
@stubs.post "/github_web_hook/KEY" do |env|
assert_equal 'www.bugherd.com', env[:url].host
assert_equal 'application/x-www-form-urlencoded',
env[:request_headers]['content-type']
[200, {}, '']
end
svc = service :push, {'project_key' => 'KEY'}, payload
svc.receive_issues
end
def test_issue_comment
@stubs.post "/github_web_hook/KEY" do |env|
assert_equal 'www.bugherd.com', env[:url].host
assert_equal 'application/x-www-form-urlencoded',
env[:request_headers]['content-type']
[200, {}, '']
end
svc = service :push, {'project_key' => 'KEY'}, payload
svc.receive_issue_comment
end
def service(*args)
super Service::BugHerd, *args
end
end