Sha256: f4a20906f3ef165267e2c12e814e9c0f1b4d44bdc1681da958159ddd6022093a

Contents?: true

Size: 445 Bytes

Versions: 68

Compression:

Stored size: 445 Bytes

Contents

require 'rails_helper'

describe LHC::Auth do
  before(:each) do
    LHC.config.interceptors = [LHC::Auth]
  end

  it 'adds the bearer token to every request' do
    def bearer_token
      '123456'
    end
    options = { bearer: -> { bearer_token } }
    LHC.config.endpoint(:local, 'http://local.ch', auth: options)
    stub_request(:get, 'http://local.ch').with(headers: { 'Authorization' => 'Bearer 123456' })
    LHC.get(:local)
  end
end

Version data entries

68 entries across 68 versions & 2 rubygems

Version Path
lhc-10.1.2 spec/interceptors/auth/bearer_spec.rb
lhc-10.1.1 spec/interceptors/auth/bearer_spec.rb
lhc-10.1.0 spec/interceptors/auth/bearer_spec.rb
lhc-10.0.2 spec/interceptors/auth/bearer_spec.rb
lhc-9.4.4 spec/interceptors/auth/bearer_spec.rb
lhc-10.0.1 spec/interceptors/auth/bearer_spec.rb
lhc-10.0.0 spec/interceptors/auth/bearer_spec.rb
lhc-9.4.3 spec/interceptors/auth/bearer_spec.rb
lhc-9.4.2 spec/interceptors/auth/bearer_spec.rb
lhc-9.4.1 spec/interceptors/auth/bearer_spec.rb
lhc-9.4.0 spec/interceptors/auth/bearer_spec.rb
lhc-9.3.1 spec/interceptors/auth/bearer_spec.rb
lhc-9.3.0 spec/interceptors/auth/bearer_spec.rb
lhc-9.2.0 spec/interceptors/auth/bearer_spec.rb
lhc-9.1.2 spec/interceptors/auth/bearer_spec.rb
lhc-9.1.2.pre spec/interceptors/auth/bearer_spec.rb
lhc-9.1.1 spec/interceptors/auth/bearer_spec.rb
lhc-8.1.1 spec/interceptors/auth/bearer_spec.rb
lhc-9.1.0 spec/interceptors/auth/bearer_spec.rb
lhc-9.0.0 spec/interceptors/auth/bearer_spec.rb