Sha256: a1a1acfb0f1c1fab9ec93526bde4658c0238018dbed628f0b29b85386743a406

Contents?: true

Size: 633 Bytes

Versions: 6

Compression:

Stored size: 633 Bytes

Contents

shared_context 'stubbed google requests' do
  let(:auth_code) { 'authcode' }
  let(:response_with_token) { { body: '{ "access_token": "access_token" },  "token_type": "Bearer", "expires_in": 3600' } }
  let(:response_with_user)  { { body: JSON.generate(authenticated_user_data), headers: { 'Content-Type' => 'application/json' } } }

  before do
    stub_request(:post, GoogleAuthenticator::TOKEN_URL).
      with(body: hash_including(grant_type: 'authorization_code')).to_return(response_with_token)
    stub_request(:get, GoogleAuthenticator::PROFILE_URL % { access_token: 'access_token' }).to_return(response_with_user)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_api_auth-0.1.0 spec/support/shared_contexts/stubbed_google_requests.rb
rails_api_auth-0.0.8 spec/support/shared_contexts/stubbed_google_requests.rb
rails_api_auth-0.0.7 spec/support/shared_contexts/stubbed_google_requests.rb
rails_api_auth-0.0.6 spec/support/shared_contexts/stubbed_google_requests.rb
rails_api_auth-0.0.5 spec/support/shared_contexts/stubbed_google_requests.rb
rails_api_auth-0.0.4 spec/support/shared_contexts/stubbed_google_requests.rb