Sha256: 04be7d16d1b4727da69a0028faf4084c9eaed22b0e090ff5987be2c9d2749691

Contents?: true

Size: 894 Bytes

Versions: 2

Compression:

Stored size: 894 Bytes

Contents

shared_context 'current auth user' do
  before do
    stub_request(:get, 'auth.g5search.com/v1/me').
      with(headers: {'Authorization'=>"Bearer #{token_value}"}).
      to_return(status: 200,
                body: raw_user_info.to_json,
                headers: {'Content-Type' => 'application/json'})
  end

  let(:raw_user_info) do
    {
      'id' => 42,
      'email' => 'fred.rogers@thehood.net',
      'first_name' => 'Fred',
      'last_name' => 'Rogers',
      'phone_number' => '(555) 555-1212',
      'organization_name' => 'The Neighborhood',
      'title' => 'Head Cardigan Wearer',
      'roles' => [
        {
          'name' => 'viewer',
          'type' => 'GLOBAL',
          'urn' => nil
        },
        {
          'name' => 'admin',
          'type' => 'G5Updatable::Client',
          'urn' => 'g5-c-some-randomly-generated-string'
        }
      ]
    }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
g5_authenticatable_api-0.4.1 spec/support/shared_contexts/current_auth_user.rb
g5_authenticatable_api-0.4.0 spec/support/shared_contexts/current_auth_user.rb