Sha256: 9fbf75eb55afc75ef3c5586d33bf8a1dae6d9a69d82ff58b064ee9c09880053a
Contents?: true
Size: 861 Bytes
Versions: 46
Compression:
Stored size: 861 Bytes
Contents
class Ey::Core::Client class Real def create_account(params={}) request( :method => :post, :path => "/accounts", :params => params, ) end end # Real class Mock def create_account(params={}) resource_id = self.uuid owner_id = params["owner"] || @current_user && @current_user["id"] find(:users, owner_id) if name_prefix = params["account"].delete("name_prefix") params["account"]["name"] = "#{name_prefix}-#{resource_id[0,4]}" end resource = mock_account_setup(resource_id, params["account"].dup) self.data[:accounts][resource_id] = resource.merge(:account_users => [owner_id], :account_owners => [owner_id]) response( :body => {"account" => resource}, :status => 201, ) end end # Mock end # Ey::Core::Client
Version data entries
46 entries across 46 versions & 2 rubygems