Sha256: 17574dad4c298315396fe92890a2e7575c2c233bf9284363e0641fdff5b571a2
Contents?: true
Size: 935 Bytes
Versions: 44
Compression:
Stored size: 935 Bytes
Contents
class Zendesk2::Client class Real def create_topic_comment(params={}) topic_id = params.delete("topic_id") path = "/topics/#{topic_id}/comments.json" request( :body => {"topic_comment" => params}, :method => :post, :path => path, ) end end # Real class Mock def create_topic_comment(params={}) identity = self.class.new_id topic_id = params["topic_id"] path = "/topics/#{topic_id}/comments.json" record = { "id" => identity, "url" => url_for("/topics/#{topic_id}/comments/#{identity}.json"), "created_at" => Time.now.iso8601, "updated_at" => Time.now.iso8601, }.merge(params) self.data[:topic_comments][identity]= record response( :method => :post, :body => {"topic_comment" => record}, :path => path, ) end end # Mock end
Version data entries
44 entries across 44 versions & 1 rubygems