Sha256: db4564fffa684ffeadbc678746bb4a8ba034555730b06f61a7bdc230eff3f741
Contents?: true
Size: 970 Bytes
Versions: 18
Compression:
Stored size: 970 Bytes
Contents
module G5Authenticatable module Test module TokenValidationHelpers def stub_valid_access_token(token_value) stub_request(:get, "#{ENV['G5_AUTH_ENDPOINT']}/oauth/token/info"). with(headers: {'Authorization'=>"Bearer #{token_value}"}). to_return(status: 200, body: '', headers: {}) end def stub_invalid_access_token(token_value) stub_request(:get, "#{ENV['G5_AUTH_ENDPOINT']}/oauth/token/info"). with(headers: {'Authorization'=>"Bearer #{token_value}"}). to_return(status: 401, headers: {'Content-Type' => 'application/json; charset=utf-8', 'Cache-Control' => 'no-cache'}, body: {'error' => 'invalid_token', 'error_description' => 'The access token expired'}.to_json) end end end end RSpec.configure do |config| config.include G5Authenticatable::Test::TokenValidationHelpers end
Version data entries
18 entries across 18 versions & 1 rubygems