Sha256: 92d7830121df71f9eb2f73d50108e93741e4c4dcaae00a9930503ef2599fbbc9
Contents?: true
Size: 669 Bytes
Versions: 37
Compression:
Stored size: 669 Bytes
Contents
class Zendesk2::Client class Real def get_ticket(params={}) id = params["id"] request( :method => :get, :path => "/tickets/#{id}.json" ) end end # Real class Mock def get_ticket(params={}) id = params["id"] path = "/tickets/#{id}.json" if body = self.data[:tickets][id] response( :path => path, :body => { "ticket" => body }, ) else response( :path => path, :status => 404, :body => {"error" => "RecordNotFound", "description" => "Not found"}, ) end end end # Mock end
Version data entries
37 entries across 37 versions & 1 rubygems