Skip to content
Browse files

parse the zoho body and test that

  • Loading branch information...
1 parent 985686a commit 45a7000b1642e9abf862798522cc95801984e767 @technoweenie technoweenie committed Jun 29, 2011
Showing with 5 additions and 3 deletions.
  1. +1 −1 docs/zohoprojects
  2. +4 −2 test/zohoprojects_test.rb
View
2 docs/zohoprojects
@@ -7,7 +7,7 @@ Install Notes
Project ID and Token is required for
configuration which will be available
under "Dashboard" --> "Project Settings"
---> "Service Hooks".
+--> "Service Hooks".
This service hook allows you to associate
changeset(s) with bug(s) in Zoho Projects.
View
6 test/zohoprojects_test.rb
@@ -15,8 +15,10 @@ def data
def test_push
url = "/serviceHook"
@stubs.post url do |env|
- assert_match /(^|\&)pId=1234($|\&)/, env[:body]
- assert_match /(^|\&)authtoken=a13d($|\&)/, env[:body]
+ params = Rack::Utils.parse_query env[:body]
+ assert_equal '1234', params['pId']
+ assert_equal 'a13d', params['authtoken']
+ assert_equal payload.to_json, params['payload']
[200, {}, '']
end

0 comments on commit 45a7000

Please sign in to comment.
Something went wrong with that request. Please try again.