From 7f26415d3c0e4101ce1569a499470e8a32dbfede Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Tue, 20 Sep 2005 07:54:55 +0000 Subject: Optimized tag_options to not sort keys, which is no longer necessary when assert_dom_equal and friend is available #1995 [skae]. Added assert_dom_equal and assert_dom_not_equal to compare tags generated by the helpers in an order-indifferent manner #1995 [skae] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2271 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/base_test.rb | 2 +- .../test/template/active_record_helper_test.rb | 18 +++--- actionpack/test/template/asset_tag_helper_test.rb | 36 ++++++----- actionpack/test/template/form_helper_test.rb | 70 +++++++++++----------- .../test/template/form_options_helper_test.rb | 68 ++++++++++----------- actionpack/test/template/form_tag_helper_test.rb | 30 +++++----- .../template/java_script_macros_helper_test.rb | 8 +-- actionpack/test/template/javascript_helper_test.rb | 56 ++++++++--------- .../test/template/upload_progress_helper_testx.rb | 14 ++--- actionpack/test/template/url_helper_test.rb | 62 +++++++++---------- 10 files changed, 186 insertions(+), 178 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb index 84ca1673e7..a0b6bc0c09 100644 --- a/actionpack/test/controller/base_test.rb +++ b/actionpack/test/controller/base_test.rb @@ -63,8 +63,8 @@ class ControllerInstanceTests < Test::Unit::TestCase @non_empty_controllers = [Controllers::NonEmptyController.new, Controllers::Submodule::ContainedNonEmptyController.new] - end + def test_action_methods @empty_controllers.each {|c| assert_equal({}, c.send(:action_methods), "#{c.class.controller_path} should be empty!")} @non_empty_controllers.each {|c| assert_equal({"public_action"=>true}, c.send(:action_methods), "#{c.class.controller_path} should not be empty!")} diff --git a/actionpack/test/template/active_record_helper_test.rb b/actionpack/test/template/active_record_helper_test.rb index 6d416fedfb..acff1b5e40 100644 --- a/actionpack/test/template/active_record_helper_test.rb +++ b/actionpack/test/template/active_record_helper_test.rb @@ -60,27 +60,27 @@ class ActiveRecordHelperTest < Test::Unit::TestCase end def test_generic_input_tag - assert_equal( + assert_dom_equal( %(), input("post", "title") ) end def test_text_area_with_errors - assert_equal( + assert_dom_equal( %(
), text_area("post", "body") ) end def test_text_field_with_errors - assert_equal( + assert_dom_equal( %(
), text_field("post", "author_name") ) end def test_form_with_string - assert_equal( + assert_dom_equal( %(


\n


), form("post") ) @@ -90,7 +90,7 @@ class ActiveRecordHelperTest < Test::Unit::TestCase def to_param() id end def id() 1 end end - assert_equal( + assert_dom_equal( %(


\n


), form("post") ) @@ -99,7 +99,7 @@ class ActiveRecordHelperTest < Test::Unit::TestCase def test_form_with_date def Post.content_columns() [ Column.new(:date, "written_on", "Written on") ] end - assert_equal( + assert_dom_equal( %(


\n\n\n

), form("post") ) @@ -109,19 +109,19 @@ class ActiveRecordHelperTest < Test::Unit::TestCase def Post.content_columns() [ Column.new(:datetime, "written_on", "Written on") ] end @post.written_on = Time.gm(2004, 6, 15, 16, 30) - assert_equal( + assert_dom_equal( %(


\n\n\n — \n : \n

), form("post") ) end def test_error_for_block - assert_equal %(

1 error prohibited this post from being saved

There were problems with the following fields:

), error_messages_for("post") + assert_dom_equal %(

1 error prohibited this post from being saved

There were problems with the following fields:

), error_messages_for("post") assert_equal %(

1 error prohibited this post from being saved

There were problems with the following fields:

), error_messages_for("post", :class => "errorDeathByClass", :id => "errorDeathById", :header_tag => "h1") end def test_form_with_string_multipart - assert_equal( + assert_dom_equal( %(


\n


), form("post", :multipart => true) ) diff --git a/actionpack/test/template/asset_tag_helper_test.rb b/actionpack/test/template/asset_tag_helper_test.rb index 84c273a72f..35cc6dd9cc 100644 --- a/actionpack/test/template/asset_tag_helper_test.rb +++ b/actionpack/test/template/asset_tag_helper_test.rb @@ -8,6 +8,8 @@ class AssetTagHelperTest < Test::Unit::TestCase def setup @controller = Class.new do + + attr_accessor :request def url_for(options, *parameters_for_method_reference) "http://www.example.com" @@ -20,6 +22,8 @@ class AssetTagHelperTest < Test::Unit::TestCase "" end end.new + + @controller.request = @request end @@ -67,31 +71,31 @@ class AssetTagHelperTest < Test::Unit::TestCase } def test_auto_discovery - AutoDiscoveryToTag.each { |method, tag| assert_equal(tag, eval(method)) } + AutoDiscoveryToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_javascript_path - JavascriptPathToTag.each { |method, tag| assert_equal(tag, eval(method)) } + JavascriptPathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_javascript_include - JavascriptIncludeToTag.each { |method, tag| assert_equal(tag, eval(method)) } + JavascriptIncludeToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_style_path - StylePathToTag.each { |method, tag| assert_equal(tag, eval(method)) } + StylePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_style_link - StyleLinkToTag.each { |method, tag| assert_equal(tag, eval(method)) } + StyleLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_image_path - ImagePathToTag.each { |method, tag| assert_equal(tag, eval(method)) } + ImagePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_image_tag - ImageLinkToTag.each { |method, tag| assert_equal(tag, eval(method)) } + ImageLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end end @@ -104,6 +108,8 @@ class AssetTagHelperNonVhostTest < Test::Unit::TestCase def setup @controller = Class.new do + attr_accessor :request + def url_for(options, *parameters_for_method_reference) "http://www.example.com/calloboration/hieraki" end @@ -116,6 +122,8 @@ class AssetTagHelperNonVhostTest < Test::Unit::TestCase end end.new + @controller.request = @request + end AutoDiscoveryToTag = { @@ -154,31 +162,31 @@ class AssetTagHelperNonVhostTest < Test::Unit::TestCase } def test_auto_discovery - AutoDiscoveryToTag.each { |method, tag| assert_equal(tag, eval(method)) } + AutoDiscoveryToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_javascript_path - JavascriptPathToTag.each { |method, tag| assert_equal(tag, eval(method)) } + JavascriptPathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_javascript_include - JavascriptIncludeToTag.each { |method, tag| assert_equal(tag, eval(method)) } + JavascriptIncludeToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_style_path - StylePathToTag.each { |method, tag| assert_equal(tag, eval(method)) } + StylePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_style_link - StyleLinkToTag.each { |method, tag| assert_equal(tag, eval(method)) } + StyleLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_image_path - ImagePathToTag.each { |method, tag| assert_equal(tag, eval(method)) } + ImagePathToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } end def test_image_tag - ImageLinkToTag.each { |method, tag| assert_equal(tag, eval(method)) } + ImageLinkToTag.each { |method, tag| assert_dom_equal(tag, eval(method)) } # Assigning a default alt tag should not cause an exception to be raised assert_nothing_raised { image_tag('') } end diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 9cc89a5860..51141770bd 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -30,52 +30,52 @@ class FormHelperTest < Test::Unit::TestCase end def test_text_field - assert_equal( + assert_dom_equal( '', text_field("post", "title") ) - assert_equal( + assert_dom_equal( '', password_field("post", "title") ) - assert_equal( + assert_dom_equal( '', password_field("person", "name") ) end def test_text_field_with_escapes @post.title = "Hello World" - assert_equal( + assert_dom_equal( '', text_field("post", "title") ) end def test_text_field_with_options expected = '' - assert_equal expected, text_field("post", "title", "size" => 35) - assert_equal expected, text_field("post", "title", :size => 35) + assert_dom_equal expected, text_field("post", "title", "size" => 35) + assert_dom_equal expected, text_field("post", "title", :size => 35) end def test_text_field_assuming_size expected = '' - assert_equal expected, text_field("post", "title", "maxlength" => 35) - assert_equal expected, text_field("post", "title", :maxlength => 35) + assert_dom_equal expected, text_field("post", "title", "maxlength" => 35) + assert_dom_equal expected, text_field("post", "title", :maxlength => 35) end def test_check_box - assert_equal( + assert_dom_equal( '', check_box("post", "secret") ) @post.secret = 0 - assert_equal( + assert_dom_equal( '', check_box("post", "secret") ) - assert_equal( + assert_dom_equal( '', check_box("post", "secret" ,{"checked"=>"checked"}) ) @post.secret = true - assert_equal( + assert_dom_equal( '', check_box("post", "secret") ) @@ -83,23 +83,23 @@ class FormHelperTest < Test::Unit::TestCase def test_check_box_with_explicit_checked_and_unchecked_values @post.secret = "on" - assert_equal( + assert_dom_equal( '', check_box("post", "secret", {}, "on", "off") ) end def test_radio_button - assert_equal('', + assert_dom_equal('', radio_button("post", "title", "Hello World") ) - assert_equal('', + assert_dom_equal('', radio_button("post", "title", "Goodbye World") ) end def test_text_area - assert_equal( + assert_dom_equal( '', text_area("post", "body") ) @@ -107,77 +107,77 @@ class FormHelperTest < Test::Unit::TestCase def test_text_area_with_escapes @post.body = "Back to the hill and over it again!" - assert_equal( + assert_dom_equal( '', text_area("post", "body") ) end def test_date_selects - assert_equal( + assert_dom_equal( '', text_area("post", "body") ) end def test_explicit_name - assert_equal( + assert_dom_equal( '', text_field("post", "title", "name" => "dont guess") ) - assert_equal( + assert_dom_equal( '', text_area("post", "body", "name" => "really!") ) - assert_equal( + assert_dom_equal( '', check_box("post", "secret", "name" => "i mean it") ) - assert_equal text_field("post", "title", "name" => "dont guess"), + assert_dom_equal text_field("post", "title", "name" => "dont guess"), text_field("post", "title", :name => "dont guess") - assert_equal text_area("post", "body", "name" => "really!"), + assert_dom_equal text_area("post", "body", "name" => "really!"), text_area("post", "body", :name => "really!") - assert_equal check_box("post", "secret", "name" => "i mean it"), + assert_dom_equal check_box("post", "secret", "name" => "i mean it"), check_box("post", "secret", :name => "i mean it") end def test_explicit_id - assert_equal( + assert_dom_equal( '', text_field("post", "title", "id" => "dont guess") ) - assert_equal( + assert_dom_equal( '', text_area("post", "body", "id" => "really!") ) - assert_equal( + assert_dom_equal( '', check_box("post", "secret", "id" => "i mean it") ) - assert_equal text_field("post", "title", "id" => "dont guess"), + assert_dom_equal text_field("post", "title", "id" => "dont guess"), text_field("post", "title", :id => "dont guess") - assert_equal text_area("post", "body", "id" => "really!"), + assert_dom_equal text_area("post", "body", "id" => "really!"), text_area("post", "body", :id => "really!") - assert_equal check_box("post", "secret", "id" => "i mean it"), + assert_dom_equal check_box("post", "secret", "id" => "i mean it"), check_box("post", "secret", :id => "i mean it") end def test_auto_index pid = @post.id - assert_equal( + assert_dom_equal( "", text_field("post[]","title") ) - assert_equal( + assert_dom_equal( "", text_area("post[]", "body") ) - assert_equal( + assert_dom_equal( "", check_box("post[]", "secret") ) - assert_equal( + assert_dom_equal( "", radio_button("post[]", "title", "Hello World") ) - assert_equal("", + assert_dom_equal("", radio_button("post[]", "title", "Goodbye World") ) end diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index d92a01a4e3..cc68312fb8 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -39,7 +39,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase Post.new("Cabe went home", "Cabe", "To a little house", "shh!") ] - assert_equal( + assert_dom_equal( "\n\n", options_from_collection_for_select(@posts, "author_name", "title") ) @@ -53,7 +53,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase Post.new("Cabe went home", "Cabe", "To a little house", "shh!") ] - assert_equal( + assert_dom_equal( "\n\n", options_from_collection_for_select(@posts, "author_name", "title", "Babe") ) @@ -66,60 +66,60 @@ class FormOptionsHelperTest < Test::Unit::TestCase Post.new("Cabe went home", "Cabe", "To a little house", "shh!") ] - assert_equal( + assert_dom_equal( "\n\n", options_from_collection_for_select(@posts, "author_name", "title", [ "Babe", "Cabe" ]) ) end def test_array_options_for_select - assert_equal( + assert_dom_equal( "\n\n", options_for_select([ "", "USA", "Sweden" ]) ) end def test_array_options_for_select_with_selection - assert_equal( + assert_dom_equal( "\n\n", options_for_select([ "Denmark", "", "Sweden" ], "") ) end def test_array_options_for_select_with_selection_array - assert_equal( + assert_dom_equal( "\n\n", options_for_select([ "Denmark", "", "Sweden" ], [ "", "Sweden" ]) ) end def test_array_options_for_string_include_in_other_string_bug_fix - assert_equal( + assert_dom_equal( "\n", options_for_select([ "ruby", "rubyonrails" ], "rubyonrails") ) - assert_equal( + assert_dom_equal( "\n", options_for_select([ "ruby", "rubyonrails" ], "ruby") ) end def test_hash_options_for_select - assert_equal( + assert_dom_equal( "\n", options_for_select({ "$" => "Dollar", "" => "" }) ) end def test_hash_options_for_select_with_selection - assert_equal( + assert_dom_equal( "\n", options_for_select({ "$" => "Dollar", "" => "" }, "Dollar") ) end def test_hash_options_for_select_with_selection - assert_equal( + assert_dom_equal( "\n", options_for_select({ "$" => "Dollar", "" => "" }, [ "Dollar", "" ]) ) @@ -131,7 +131,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase Continent.new("Europe", [Country.new("dk", "Denmark"), Country.new("ie", "Ireland")] ) ] - assert_equal( + assert_dom_equal( "\n\n", option_groups_from_collection_for_select(@continents, "countries", "continent_name", "country_id", "country_name", "dk") ) @@ -139,7 +139,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_time_zone_options_no_parms opts = time_zone_options_for_select - assert_equal "\n" + + assert_dom_equal "\n" + "\n" + "\n" + "\n" + @@ -149,7 +149,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_time_zone_options_with_selected opts = time_zone_options_for_select( "D" ) - assert_equal "\n" + + assert_dom_equal "\n" + "\n" + "\n" + "\n" + @@ -159,7 +159,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_time_zone_options_with_unknown_selected opts = time_zone_options_for_select( "K" ) - assert_equal "\n" + + assert_dom_equal "\n" + "\n" + "\n" + "\n" + @@ -170,7 +170,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_time_zone_options_with_priority_zones zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ] opts = time_zone_options_for_select( nil, zones ) - assert_equal "\n" + + assert_dom_equal "\n" + "" + "\n" + "\n" + @@ -182,7 +182,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_time_zone_options_with_selected_priority_zones zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ] opts = time_zone_options_for_select( "E", zones ) - assert_equal "\n" + + assert_dom_equal "\n" + "" + "\n" + "\n" + @@ -194,7 +194,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_time_zone_options_with_unselected_priority_zones zones = [ TimeZone.new( "B" ), TimeZone.new( "E" ) ] opts = time_zone_options_for_select( "C", zones ) - assert_equal "\n" + + assert_dom_equal "\n" + "" + "\n" + "\n" + @@ -206,7 +206,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_select @post = Post.new @post.category = "" - assert_equal( + assert_dom_equal( "", select("post", "category", %w( abe hest)) ) @@ -215,7 +215,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_select_with_blank @post = Post.new @post.category = "" - assert_equal( + assert_dom_equal( "", select("post", "category", %w( abe hest), :include_blank => true) ) @@ -224,7 +224,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_select_with_default_prompt @post = Post.new @post.category = "" - assert_equal( + assert_dom_equal( "", select("post", "category", %w( abe hest), :prompt => true) ) @@ -233,7 +233,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_select_no_prompt_when_select_has_value @post = Post.new @post.category = "" - assert_equal( + assert_dom_equal( "", select("post", "category", %w( abe hest), :prompt => true) ) @@ -242,7 +242,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_select_with_given_prompt @post = Post.new @post.category = "" - assert_equal( + assert_dom_equal( "", select("post", "category", %w( abe hest), :prompt => 'The prompt') ) @@ -251,7 +251,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_select_with_prompt_and_blank @post = Post.new @post.category = "" - assert_equal( + assert_dom_equal( "", select("post", "category", %w( abe hest), :prompt => true, :include_blank => true) ) @@ -267,7 +267,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase @post = Post.new @post.author_name = "Babe" - assert_equal( + assert_dom_equal( "", collection_select("post", "author_name", @posts, "author_name", "author_name") ) @@ -283,7 +283,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase @post = Post.new @post.author_name = "Babe" - assert_equal( + assert_dom_equal( "", collection_select("post", "author_name", @posts, "author_name", "author_name", { :include_blank => true }, "style" => "width: 200px") ) @@ -292,7 +292,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase def test_country_select @post = Post.new @post.origin = "Denmark" - assert_equal( + assert_dom_equal( "" + + assert_dom_equal "" + + assert_dom_equal "" + + assert_dom_equal "", html - assert_equal html, time_zone_select("firm", "time_zone", nil, {}, + assert_dom_equal html, time_zone_select("firm", "time_zone", nil, {}, :style => "color: red") end @@ -348,7 +348,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase @firm = Firm.new("D") html = time_zone_select("firm", "time_zone", nil, { :include_blank => true }, "style" => "color: red") - assert_equal "" + "\n" + "\n" + "\n" + @@ -357,7 +357,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase "" + "", html - assert_equal html, time_zone_select("firm", "time_zone", nil, + assert_dom_equal html, time_zone_select("firm", "time_zone", nil, { :include_blank => true }, :style => "color: red") end @@ -365,7 +365,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase @firm = Firm.new("D") zones = [ TimeZone.new("A"), TimeZone.new("D") ] html = time_zone_select("firm", "time_zone", zones ) - assert_equal "" + "\n" + "" + "\n" + diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index 6295aa91b6..1fc84744e8 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -18,74 +18,74 @@ class FormTagHelperTest < Test::Unit::TestCase def test_check_box_tag actual = check_box_tag "admin" expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_form_tag actual = form_tag expected = %(
) - assert_equal expected, actual + assert_dom_equal expected, actual end def test_form_tag_multipart actual = form_tag({}, { 'multipart' => true }) expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_hidden_field_tag actual = hidden_field_tag "id", 3 expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_password_field_tag actual = password_field_tag expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_radio_button_tag actual = radio_button_tag "people", "david" expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_select_tag actual = select_tag "people", "" expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_text_area_tag_size_string actual = text_area_tag "body", "hello world", "size" => "20x40" expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_text_area_tag_size_symbol actual = text_area_tag "body", "hello world", :size => "20x40" expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_text_field_tag actual = text_field_tag "title", "Hello!" expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_text_field_tag_class_string actual = text_field_tag "title", "Hello!", "class" => "admin" expected = %() - assert_equal expected, actual + assert_dom_equal expected, actual end def test_boolean_optios - assert_equal %(), check_box_tag("admin", 1, true, 'disabled' => true, :readonly => "yes") - assert_equal %(), check_box_tag("admin", 1, true, :disabled => false, :readonly => nil) - assert_equal %(), select_tag("people", "", :multiple => true) - assert_equal %(), select_tag("people", "", :multiple => nil) + assert_dom_equal %(), check_box_tag("admin", 1, true, 'disabled' => true, :readonly => "yes") + assert_dom_equal %(), check_box_tag("admin", 1, true, :disabled => false, :readonly => nil) + assert_dom_equal %(), select_tag("people", "", :multiple => true) + assert_dom_equal %(), select_tag("people", "", :multiple => nil) end end diff --git a/actionpack/test/template/java_script_macros_helper_test.rb b/actionpack/test/template/java_script_macros_helper_test.rb index 763eb3d5e9..5b305eb5ee 100644 --- a/actionpack/test/template/java_script_macros_helper_test.rb +++ b/actionpack/test/template/java_script_macros_helper_test.rb @@ -23,11 +23,11 @@ class JavaScriptMacrosHelperTest < Test::Unit::TestCase def test_auto_complete_field - assert_equal %(), + assert_dom_equal %(), auto_complete_field("some_input", :url => { :action => "autocomplete" }); - assert_equal %(), + assert_dom_equal %(), auto_complete_field("some_input", :url => { :action => "autocomplete" }, :tokens => ','); - assert_equal %(), + assert_dom_equal %(), auto_complete_field("some_input", :url => { :action => "autocomplete" }, :tokens => [',']); end @@ -46,7 +46,7 @@ class JavaScriptMacrosHelperTest < Test::Unit::TestCase def test_text_field_with_auto_complete assert_match "