Sha256: 35ede5d7f947359ceee180e5c2ee822c65e54b8466f4b32ba367ce0123bf543d

Contents?: true

Size: 636 Bytes

Versions: 49

Compression:

Stored size: 636 Bytes

Contents

# frozen_string_literal: true

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

49 entries across 49 versions & 1 rubygems

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