Permalink
Browse files

Merge branch 'requests' into dev

  • Loading branch information...
2 parents 6e05936 + 01d01af commit 0f0ac1193d6286f4a15ff347da3f4f07b3cb1015 @mutle committed Dec 11, 2012
Showing with 30 additions and 0 deletions.
  1. +1 −0 lib/zendesk2/client.rb
  2. +29 −0 lib/zendesk2/client/requests/update_request.rb
View
@@ -59,6 +59,7 @@ class Zendesk2::Client < Cistern::Service
request :update_topic
request :update_topic_comment
request :update_organization
+ request :update_request
request :update_ticket
request :update_user
@@ -0,0 +1,29 @@
+class Zendesk2::Client
+ class Real
+ def update_request(params={})
+ id = params.delete("id")
+
+ request(
+ :method => :put,
+ :path => "/requests/#{id}.json",
+ :body => {
+ "request" => params
+ },
+ )
+ end
+ end
+ class Mock
+ def update_request(params={})
+ id = params.delete("id")
+ body = self.data[:tickets][id].merge!(params)
+
+ response(
+ :method => :put,
+ :path => "/tickets/#{id}.json",
+ :body => {
+ "request" => body
+ },
+ )
+ end
+ end
+end

0 comments on commit 0f0ac11

Please sign in to comment.