From ebdaaf9cf4294be7204bb524bdeb7c40709b8caa Mon Sep 17 00:00:00 2001 From: Johny Ho Date: Wed, 7 Oct 2026 12:50:15 +0200 Subject: [PATCH] Support json 3.0 in the test suite json 3.0 rejects duplicate keys when parsing by default, so the spec asserting "the last one wins" now opts in with allow_duplicate_key. ActiveSupport 7.1 and 8.0 pass quirks_mode to JSON.generate, which json 3.0 now rejects as an unknown option. Pin json below 3 for those Rails versions. Rails 7.2, 8.1, and main are unaffected. Co-Authored-By: Claude Opus 5.5 --- Gemfile | 1 + Gemfile.71 | 1 + Gemfile.80 | 1 + spec/props_template_spec.rb | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 601147d..3277ba5 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ gemspec gem "rspec" gem "byebug" gem "rails", "~> 7.1.0" +gem "json", "< 3" gem "analyzer", git: "https://github.com/thoughtbot/analyzer.git" gem "multi_json" gem "rabl" diff --git a/Gemfile.71 b/Gemfile.71 index 3606490..04b8610 100644 --- a/Gemfile.71 +++ b/Gemfile.71 @@ -4,4 +4,5 @@ gemspec gem "rspec" gem "byebug" gem "rails", "~> 7.1.0" +gem "json", "< 3" gem "standard", group: [:development, :test] diff --git a/Gemfile.80 b/Gemfile.80 index 235a6d2..270abc6 100644 --- a/Gemfile.80 +++ b/Gemfile.80 @@ -4,4 +4,5 @@ gemspec gem "rspec" gem "byebug" gem "rails", "~> 8.0.0" +gem "json", "< 3" gem "standard", group: [:development, :test] diff --git a/spec/props_template_spec.rb b/spec/props_template_spec.rb index cb475b0..95e1e0b 100644 --- a/spec/props_template_spec.rb +++ b/spec/props_template_spec.rb @@ -98,7 +98,7 @@ json.set! :foo, "bar" json.set! :foo, "cool" - attrs = JSON.parse(json.result!) + attrs = JSON.parse(json.result!, allow_duplicate_key: true) expect(attrs).to eql({ "foo" => "cool"