spec/faraday/params_encoder_spec.rb in mrkt-1.2.0 vs spec/faraday/params_encoder_spec.rb in mrkt-1.2.1
- old
+ new
@@ -1,24 +1,24 @@
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
- subject { described_class.encode(params) }
-
it { is_expected.to eq(Faraday::Utils::ParamsHash.new.merge(params.merge(array: '1,2,3')).to_query) }
end
describe '.decode' do
- let(:value) { 'foo=foo&bar=bar' }
-
subject { described_class.decode(value) }
+
+ let(:value) { 'foo=foo&bar=bar' }
it { is_expected.to eq('foo' => 'foo', 'bar' => 'bar') }
end
end