lib/zendesk2/client/requests/update_ticket.rb in zendesk2-1.2.10 vs lib/zendesk2/client/requests/update_ticket.rb in zendesk2-1.3.0

- old
+ new

@@ -10,10 +10,11 @@ "ticket" => params }, ) end end + class Mock def update_ticket(params={}) ticket_id = params.delete("id") body = self.find!(:tickets, ticket_id).merge!(params) @@ -29,11 +30,12 @@ "trusted" => comment["trusted"].nil? ? true : comment["trusted"], "attachments" => comment["attachments"] || [], } audit_id = self.class.new_id - self.data[:ticket_audits][audit_id] = { + + self.data[:ticket_audits][audit_id] = audit = { "id" => audit_id, "ticket_id" => ticket_id, "created_at" => Time.now, "author_id" => current_user["id"], "via" => { @@ -60,10 +62,11 @@ response( :method => :put, :path => "/tickets/#{ticket_id}.json", :body => { - "ticket" => body + "ticket" => body, + "audit" => audit, }, ) end end end