Sha256: e749dfc546483aba3727078eda3f7b39931b49f29474cf1874167fc431a5b8d3

Contents?: true

Size: 476 Bytes

Versions: 49

Compression:

Stored size: 476 Bytes

Contents

# frozen_string_literal: true

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

49 entries across 49 versions & 1 rubygems

Version Path
lhc-15.2.1 spec/interceptors/auth/bearer_spec.rb
lhc-15.2.0 spec/interceptors/auth/bearer_spec.rb
lhc-15.1.3 spec/interceptors/auth/bearer_spec.rb
lhc-15.1.2 spec/interceptors/auth/bearer_spec.rb
lhc-15.1.1 spec/interceptors/auth/bearer_spec.rb
lhc-15.1.0 spec/interceptors/auth/bearer_spec.rb
lhc-16.0.0.pre.pro2162.2 spec/interceptors/auth/bearer_spec.rb
lhc-16.0.0.pre.pro2162 spec/interceptors/auth/bearer_spec.rb
lhc-15.0.1 spec/interceptors/auth/bearer_spec.rb
lhc-15.0.0 spec/interceptors/auth/bearer_spec.rb
lhc-14.0.0 spec/interceptors/auth/bearer_spec.rb
lhc-13.4.0.pre.pro1766.1 spec/interceptors/auth/bearer_spec.rb
lhc-13.2.0 spec/interceptors/auth/bearer_spec.rb
lhc-13.1.0 spec/interceptors/auth/bearer_spec.rb
lhc-13.0.0 spec/interceptors/auth/bearer_spec.rb
lhc-12.3.0 spec/interceptors/auth/bearer_spec.rb
lhc-12.2.1 spec/interceptors/auth/bearer_spec.rb
lhc-12.2.0 spec/interceptors/auth/bearer_spec.rb
lhc-12.1.3 spec/interceptors/auth/bearer_spec.rb
lhc-12.1.2 spec/interceptors/auth/bearer_spec.rb