Sha256: 24ff9629f5289c7bdaeded595ad3ff6a865c9edad1393e38f5cc235aa91be84b

Contents?: true

Size: 636 Bytes

Versions: 6

Compression:

Stored size: 636 Bytes

Contents

require 'spec_helper'

describe LHC::Request do
  before do
    Object.send(:remove_const, :Rails)
    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}) [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_without_rails_spec.rb
lhc-10.1.1 spec/request/user_agent_without_rails_spec.rb
lhc-10.1.0 spec/request/user_agent_without_rails_spec.rb
lhc-10.0.2 spec/request/user_agent_without_rails_spec.rb
lhc-10.0.1 spec/request/user_agent_without_rails_spec.rb
lhc-10.0.0 spec/request/user_agent_without_rails_spec.rb