From f01ee089d3bf4241484afd3e6ed50eec1eb51259 Mon Sep 17 00:00:00 2001 From: Andy Pfister Date: Mon, 21 Feb 2022 20:16:26 +0100 Subject: [PATCH] Expect "autocomplete=off" for hidden input fields in Rails 7 Looks like this was introduced to "fix" a bug in Firefox: https://github.com/rails/rails/issues/42610 https://github.com/rails/rails/pull/43280 --- spec/web/authorize_spec.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spec/web/authorize_spec.rb b/spec/web/authorize_spec.rb index 93737a3..6ec496a 100644 --- a/spec/web/authorize_spec.rb +++ b/spec/web/authorize_spec.rb @@ -77,8 +77,14 @@ end end - it "should generate valid form field string" do - expect(@view.datatrans_notification_request_hidden_fields(@datatrans, @transaction)).to eq "" + it 'should generate valid form field string' do + if Gem.loaded_specs['activesupport'].version >= Gem::Version.create('7.0') + expected_output = '' + else + expected_output = '' + end + + expect(@view.datatrans_notification_request_hidden_fields(@datatrans, @transaction)).to eq expected_output end end