Sha256: cacb4da2936243556ce80c5e299d8bc8952bf759278defa823a78751292cd808

Contents?: true

Size: 826 Bytes

Versions: 26

Compression:

Stored size: 826 Bytes

Contents

require 'rails_helper'

describe LHC::Request do
  context 'without an encoding setting' do
    it 'encodes array params in default rack format' do
      stub_request(:get, 'http://datastore/q?a%5B%5D=1&a%5B%5D=2&a%5B%5D=3')
      LHC.get('http://datastore/q', params: { a: [1, 2, 3] })
    end
  end

  context 'with encoding set to :rack' do
    it 'encodes array params in rack format' do
      stub_request(:get, 'http://datastore/q?a%5B%5D=1&a%5B%5D=2&a%5B%5D=3')
      LHC.get('http://datastore/q', params: { a: [1, 2, 3] }, params_encoding: :rack)
    end
  end

  context 'with encoding set to :multi' do
    it 'encodes array params in multi format' do
      stub_request(:get, 'http://datastore/q?a=1&a=2&a=3')
      LHC.get('http://datastore/q', params: { a: [1, 2, 3] }, params_encoding: :multi)
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
lhc-10.1.2 spec/request/params_encoding_spec.rb
lhc-10.1.1 spec/request/params_encoding_spec.rb
lhc-10.1.0 spec/request/params_encoding_spec.rb
lhc-10.0.2 spec/request/params_encoding_spec.rb
lhc-9.4.4 spec/request/params_encoding_spec.rb
lhc-10.0.1 spec/request/params_encoding_spec.rb
lhc-10.0.0 spec/request/params_encoding_spec.rb
lhc-9.4.3 spec/request/params_encoding_spec.rb
lhc-9.4.2 spec/request/params_encoding_spec.rb
lhc-9.4.1 spec/request/params_encoding_spec.rb
lhc-9.4.0 spec/request/params_encoding_spec.rb
lhc-9.3.1 spec/request/params_encoding_spec.rb
lhc-9.3.0 spec/request/params_encoding_spec.rb
lhc-9.2.0 spec/request/params_encoding_spec.rb
lhc-9.1.2 spec/request/params_encoding_spec.rb
lhc-9.1.2.pre spec/request/params_encoding_spec.rb
lhc-9.1.1 spec/request/params_encoding_spec.rb
lhc-8.1.1 spec/request/params_encoding_spec.rb
lhc-9.1.0 spec/request/params_encoding_spec.rb
lhc-9.0.0 spec/request/params_encoding_spec.rb