Skip to content
This repository has been archived by the owner on Jan 31, 2019. It is now read-only.

Commit

Permalink
fix busted hipchat tests
Browse files Browse the repository at this point in the history
  • Loading branch information
technoweenie committed Dec 30, 2012
1 parent f631fa9 commit 70690cb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/hip_chat_test.rb
Expand Up @@ -6,15 +6,17 @@ def setup
end

def test_push
payload = {'a' => 1, 'ref' => 'refs/heads/master'}
@stubs.post "/v1/webhooks/github" do |env|
assert_match /(^|\&)payload=%7B%22a%22%3A1%7D($|\&)/, env[:body]
assert_match "auth_token=a", env[:body]
assert_match "room_id=r", env[:body]
form = Rack::Utils.parse_query(env[:body])
assert_equal payload, JSON.parse(form['payload'])
assert_equal 'a', form['auth_token']
assert_equal 'r', form['room_id']
[200, {}, '']
end

svc = service(
{'auth_token' => 'a', 'room' => 'r'}, 'a' => 1)
{'auth_token' => 'a', 'room' => 'r'}, payload)
svc.receive_event
end

Expand Down

0 comments on commit 70690cb

Please sign in to comment.