Sha256: 58f1cbf7b369b68e7634bd6732e903e5189d0fbd1d775b6957658d00e95b1f68

Contents?: true

Size: 545 Bytes

Versions: 2

Compression:

Stored size: 545 Bytes

Contents

describe Mrkt::Faraday::ParamsEncoder do
  describe '.encode' do
    subject { described_class.encode(params) }

    let(:params) do
      {
        string: 'foobar',
        number: 1,
        boolean: true,
        array: [1, 2, 3]
      }
    end

    it { is_expected.to eq(Faraday::Utils::ParamsHash.new.merge(params.merge(array: '1,2,3')).to_query) }
  end

  describe '.decode' do
    subject { described_class.decode(value) }

    let(:value) { 'foo=foo&bar=bar' }

    it { is_expected.to eq('foo' => 'foo', 'bar' => 'bar') }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mrkt-1.2.2 spec/faraday/params_encoder_spec.rb
mrkt-1.2.1 spec/faraday/params_encoder_spec.rb