Permalink
Browse files

Add update_requests

  • Loading branch information...
1 parent a2a602f commit 01d01af66fca96eb0ae24a2d482d9df4f2d699f4 @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
@@ -57,6 +57,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 01d01af

Please sign in to comment.