Sha256: 02e87d47614b0274bf188128ea1d7f3e22b17e31488576b6ff2a80c2f9ddbf33

Contents?: true

Size: 571 Bytes

Versions: 7

Compression:

Stored size: 571 Bytes

Contents

require 'rails_helper'

describe LHC::Request do

  context 'encoding url' do

    let(:url) { 'http://local.ch/something with spaces' }

    it 'can request urls with spaces inside' do
      stub_request(:get, URI::encode(url))
      LHC.get(url)
    end
  end

  context 'encoding params' do

    let(:url) { 'http://local.ch/api/search?name=:name' }

    it 'can do requests with params including spaces' do
      stub_request(:get, 'http://local.ch/api/search?name=My%20name%20is%20rabbit')
      LHC.get(url, params: { name: 'My name is rabbit' })
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lhc-3.4.0 spec/request/encoding_spec.rb
lhc-3.3.0 spec/request/encoding_spec.rb
lhc-3.2.0 spec/request/encoding_spec.rb
lhc-3.1.1 spec/request/encoding_spec.rb
lhc-3.1.0 spec/request/encoding_spec.rb
lhc-3.0.0 spec/request/encoding_spec.rb
lhc-2.0.0 spec/request/encoding_spec.rb