Sha256: b46e76d8ba5679361f82b0f77266f567b4fb1d75e336af0df6b3a736bdebf3a9

Contents?: true

Size: 605 Bytes

Versions: 6

Compression:

Stored size: 605 Bytes

Contents

require 'rails_helper'

describe LHC::Request do
  before do
    LHC.send(:remove_const, :Request)
    load('lhc/concerns/lhc/request/user_agent_concern.rb')
    load('lhc/request.rb')
  end

  context 'default headers' do
    context 'agent' do
      it 'sets header agent information to be LHC' do
        stub_request(:get, "http://local.ch/")
          .with(
            headers: {
              'User-Agent' => "LHC (#{LHC::VERSION}; Dummy) [https://github.com/local-ch/lhc]"
            }
          )
          .to_return(status: 200)
        LHC.get('http://local.ch')
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lhc-10.1.2 spec/request/user_agent_spec.rb
lhc-10.1.1 spec/request/user_agent_spec.rb
lhc-10.1.0 spec/request/user_agent_spec.rb
lhc-10.0.2 spec/request/user_agent_spec.rb
lhc-10.0.1 spec/request/user_agent_spec.rb
lhc-10.0.0 spec/request/user_agent_spec.rb