spec/unit/request_pattern_spec.rb in webmock-1.18.0 vs spec/unit/request_pattern_spec.rb in webmock-1.19.0

- old
+ new

@@ -284,9 +284,24 @@ it "should not match when query params are declared as RSpec HashIncluding matcher not matching params" do WebMock::RequestPattern.new(:get, "www.example.com", :query => RSpec::Mocks::ArgumentMatchers::HashIncludingMatcher.new({"a" => ["b", "d"]})). should_not match(WebMock::RequestSignature.new(:get, "www.example.com?a[]=b&a[]=c&b=1")) end + + context "when using query values notation as flat array" do + before :all do + WebMock::Config.instance.query_values_notation = :flat_array + end + + it "should not match when repeated query params are not the same as declared as string" do + WebMock::RequestPattern.new(:get, "www.example.com", :query => "a=b&a=c"). + should match(WebMock::RequestSignature.new(:get, "www.example.com?a=b&a=c")) + end + + after :all do + WebMock::Config.instance.query_values_notation = nil + end + end end end describe "when matching requests with body" do