From 5b83655c0ed14c921f7fad1b8c1400c9fbb34617 Mon Sep 17 00:00:00 2001 From: Denis Date: Mon, 23 Oct 2023 13:57:43 -0700 Subject: [PATCH] Accomodate variable escaping output --- spec/helpers/canonical_rails/tag_helper_spec.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/spec/helpers/canonical_rails/tag_helper_spec.rb b/spec/helpers/canonical_rails/tag_helper_spec.rb index dadee18..f4a76dd 100644 --- a/spec/helpers/canonical_rails/tag_helper_spec.rb +++ b/spec/helpers/canonical_rails/tag_helper_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' +require 'uri' describe CanonicalRails::TagHelper, type: :helper do before(:each) do @@ -204,11 +205,15 @@ end it 'should escape allowed params properly' do - expect(helper.allowed_query_string).to eq '?page=5&keywords=%22here+be+dragons%22&search%5Bsuper%5D=special' + expect(helper.allowed_query_string).to eq('?page=5&keywords=%22here+be+dragons%22&search%5Bsuper%5D=special'). + or(eq('?page=5&keywords=%22here+be+dragons%22&search[super]=special')) end it 'should output allowed params using proper syntax (?key=value&key=value)' do - expect(helper.canonical_tag).to eq '' + # https://github.com/rack/rack/issues/792 + # this will produce different results depending on Ruby version + expect(helper.canonical_tag).to eq(''). + or(eq('')) end describe 'on a collection action' do