Permalink
Browse files

Ruby 1.9 compat: account for hash ordering

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8588 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 3a62e0e commit 3600536b04ca7e902c5ad594175feb451261cc81 @jeremy jeremy committed Jan 7, 2008
Showing with 3 additions and 4 deletions.
  1. +3 −4 actionpack/test/template/form_options_helper_test.rb
View
7 actionpack/test/template/form_options_helper_test.rb
@@ -109,19 +109,18 @@ def test_array_options_for_string_include_in_other_string_bug_fix
)
end
- # FIXME: fails on Ruby 1.9, probably in html-scanner
def test_hash_options_for_select
assert_dom_equal(
"<option value=\"&lt;Kroner&gt;\">&lt;DKR&gt;</option>\n<option value=\"Dollar\">$</option>",
- options_for_select({ "$" => "Dollar", "<DKR>" => "<Kroner>" })
+ options_for_select("$" => "Dollar", "<DKR>" => "<Kroner>").split("\n").sort.join("\n")
)
assert_dom_equal(
"<option value=\"&lt;Kroner&gt;\">&lt;DKR&gt;</option>\n<option value=\"Dollar\" selected=\"selected\">$</option>",
- options_for_select({ "$" => "Dollar", "<DKR>" => "<Kroner>" }, "Dollar")
+ options_for_select({ "$" => "Dollar", "<DKR>" => "<Kroner>" }, "Dollar").split("\n").sort.join("\n")
)
assert_dom_equal(
"<option value=\"&lt;Kroner&gt;\" selected=\"selected\">&lt;DKR&gt;</option>\n<option value=\"Dollar\" selected=\"selected\">$</option>",
- options_for_select({ "$" => "Dollar", "<DKR>" => "<Kroner>" }, [ "Dollar", "<Kroner>" ])
+ options_for_select({ "$" => "Dollar", "<DKR>" => "<Kroner>" }, [ "Dollar", "<Kroner>" ]).split("\n").sort.join("\n")
)
end

0 comments on commit 3600536

Please sign in to comment.