Sha256: b16e2b6ee07cfd1a9116f131bf85a2d82768029a534586ce2624113999b18534
Contents?: true
Size: 1.07 KB
Versions: 8
Compression:
Stored size: 1.07 KB
Contents
class Zendesk2::Client class Real def update_help_center_article(params={}) id = require_parameters(params, "id") locale = params["locale"] path = if locale "/help_center/#{locale}/articles/#{id}.json" else "/help_center/articles/#{id}.json" end request( :method => :put, :path => path, :body => { "article" => params }, ) end end class Mock def update_help_center_article(params={}) params = Cistern::Hash.stringify_keys(params) require_parameters(params, "id") id = params.delete("id") locale = params["locale"] path = if locale "/help_center/#{locale}/articles/#{id}.json" else "/help_center/articles/#{id}.json" end body = self.data[:help_center_articles][id.to_i].merge!(params) response( :method => :put, :path => path, :body => { "article" => body, }, ) end end end
Version data entries
8 entries across 8 versions & 1 rubygems