Sha256: 2da40584b9255e0894b7c13dc81fd1187fb6f5c3cb64c5feaf8c0c215a91a603
Contents?: true
Size: 841 Bytes
Versions: 25
Compression:
Stored size: 841 Bytes
Contents
module Fog module Identity class OpenStack class V2 class Real def get_user_by_id(user_id) request( :expects => [200, 203], :method => 'GET', :path => "users/#{user_id}" ) end end class Mock def get_user_by_id(user_id) response = Excon::Response.new response.status = 200 existing_user = data[:users].find do |u| u[0] == user_id || u[1]['name'] == 'mock' end existing_user = existing_user[1] if existing_user response.body = { 'user' => existing_user || create_user('mock', 'mock', 'mock@email.com').body['user'] } response end end end end end end
Version data entries
25 entries across 23 versions & 3 rubygems