forked from github/github-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcube_test.rb
More file actions
29 lines (23 loc) · 666 Bytes
/
Copy pathcube_test.rb
File metadata and controls
29 lines (23 loc) · 666 Bytes
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
require File.expand_path('../helper', __FILE__)
class CubeTest < Service::TestCase
def setup
@stubs = Faraday::Adapter::Test::Stubs.new
end
def test_push
url = "/integration/events/github/create"
@stubs.post url do |env|
assert_match /(^|\&)payload=%7B%22a%22%3A1%7D($|\&)/, env[:body]
assert_match "project_name=p", env[:body]
assert_match "project_token=t", env[:body]
assert_match "domain=d", env[:body]
[200, {}, '']
end
svc = service(
{'project' => 'p', 'token' => 't', 'domain' => 'd'},
'a' => 1)
svc.receive_push
end
def service(*args)
super Service::Cube, *args
end
end