forked from github/github-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_test.rb
More file actions
30 lines (23 loc) · 687 Bytes
/
Copy pathdocker_test.rb
File metadata and controls
30 lines (23 loc) · 687 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
28
29
30
require File.expand_path('../helper', __FILE__)
class DockerTest < Service::TestCase
include Service::HttpTestMethods
def test_push
data = {}
payload = {'commits'=>[{'id'=>'test'}]}
svc = service(data, payload)
@stubs.post "/hooks/github" do |env|
body = JSON.parse(env[:body])
assert_equal env[:url].host, "index.docker.io"
assert_equal 'test', body['payload']['commits'][0]['id']
assert_match 'guid-', body['guid']
assert_equal data, body['config']
assert_equal 'push', body['event']
[200, {}, '']
end
svc.receive_event
@stubs.verify_stubbed_calls
end
def service_class
Service::Docker
end
end