Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some 6-1-stable tests for Ruby 2.5 and 2.6 #45074

Merged
merged 1 commit into from
May 12, 2022

Commits on May 12, 2022

  1. Fix failing test on 6-1-stable for Ruby 2.5 and 2.6

    6-1-stable currently has failing tests: https://buildkite.com/rails/rails/builds/86353
    
          assert_equal "<the-name #{escaped_dangerous_chars}=\"the value\"></the-name>",
            tag.public_send(:"the-name", COMMON_DANGEROUS_CHARS => "the value")
    
          TagHelperTest#test_tag_builder_with_dangerous_unknown_attribute_name [/rails/actionview/test/template/tag_helper_test.rb:179]:
          --- expected
          +++ actual
          @@ -1 +1 @@
          -"<the-name _______________=\"the value\"></the-name>"
          +"<the-name>{&quot;&amp;&lt;&gt;\\&quot;&rails#39; %*+,/;=^|&quot;=&gt;&quot;the value&quot;}</the-name>"
    
    The test fails because the `attributes` hash argument has string keys.
    In Ruby 2.5 and 2.6 only Symbol keys are allowed in keyword arguments.
    So the argument is seen as the `content` argument for the tag instead of the
    `attributes`.
    
    This test was introduced in 123f42a.
    Running the test prior to 123f42a generates the same error.
    
    Calling `to_sym` on the key fixes the test.
    p8 committed May 12, 2022
    Configuration menu
    Copy the full SHA
    507b5aa View commit details
    Browse the repository at this point in the history