Sha256: ebef621e6134c95b47c2f2e989ee8ff6d79ae38415b2b9f3581686713334126a
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
class Zendesk2::Client class Real def create_membership(params={}) user_id = params["user_id"] request( :body => {"organization_membership" => params }, :method => :post, :path => "/users/#{user_id}/organization_memberships.json", ) end end # Real class Mock def create_membership(params={}) user_id = params["user_id"] organization_id = params["organization_id"] resource_id = self.class.new_id default_membership = false # !self.data[:memberships].values.find { |m| m["user_id"] == user_id && m["default"] } resource = { "id" => resource_id, "user_id" => user_id, "organization_id" => organization_id, "default" => default_membership, } self.data[:memberships][resource_id] = resource response( :method => :post, :body => { "organization_membership" => resource }, :path => "/users/#{user_id}/organization_memberships.json", ) end end # Mock end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
zendesk2-0.4.4 | lib/zendesk2/client/requests/create_membership.rb |