Sha256: 9f437e0ad7b1084fd5d5a1e3a885bf2d1625bbd3a3380ff6f58ec06e5dca9721
Contents?: true
Size: 927 Bytes
Versions: 15
Compression:
Stored size: 927 Bytes
Contents
class Ey::Core::Client class Real def create_membership(params={}) query_params = {"membership" => params["membership"]} body = query_params.to_json request( :method => :post, :path => "/memberships", :body => body ) end end # Real class Mock def create_membership(params={}) id = self.uuid membership = { "id" => id, "account" => url_for("/accounts/"+params["membership"]["account"]), "user" => url_for("/users/"+params["membership"]["user"]), "role" => params["membership"]["role"], #NOTE missing attributes: email, created_at, updated_at, deleted_at, requester_url #also "implied" attribute: accepted = false } self.data[:memberships][id] = membership response( :body => {"membership" => membership}, :status => 201 ) end end # Mock end
Version data entries
15 entries across 15 versions & 1 rubygems