Verified Commit be476081 authored by andrey's avatar andrey 🇱🇻 Committed by GitLab
Browse files

test(excon_publisher): update nil-query expectation for Rails 8.1

Rails 8.1 changed Object#to_param to return nil (instead of "") for
nil values, so Hash#to_query now emits `key` instead of `key=` for
nil-valued keys. Update the expected payload to match.

See https://github.com/rails/rails/pull/52610
parent c907bfa1
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -124,11 +124,7 @@ describe Labkit::ExconPublisher do
          [
            {
              method: "GET", code: "200",
              scheme: "http", host: "127.0.0.1", port: 9202, path: "/api/v1/tests",
              # Rails 8.1 changed Object#to_param so that nil serializes as the bare key
              # ("nil_key") instead of an empty assignment ("nil_key=").
              # See https://github.com/rails/rails/pull/52610
              query: ActiveSupport.gem_version >= Gem::Version.new("8.1.0") ? "abc=1&nil_key&xyz=2" : "abc=1&nil_key=&xyz=2",
              scheme: "http", host: "127.0.0.1", port: 9202, path: "/api/v1/tests", query: "abc=1&nil_key&xyz=2",
            },
          ],
        ],