aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/form_helper_test.rb6
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb4
-rw-r--r--actionpack/test/template/javascript_helper_test.rb2
-rw-r--r--actionpack/test/template/tag_helper_test.rb8
4 files changed, 14 insertions, 6 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb
index b76f21d80b..1b9df865f3 100644
--- a/actionpack/test/template/form_helper_test.rb
+++ b/actionpack/test/template/form_helper_test.rb
@@ -37,7 +37,7 @@ class FormHelperTest < Test::Unit::TestCase
'<input id="post_title" name="post[title]" size="30" type="password" value="Hello World" />', password_field("post", "title")
)
assert_equal(
- '<input id="person_name" name="person[name]" size="30" type="password" value="" />', password_field("person", "name")
+ '<input id="person_name" name="person[name]" size="30" type="password" />', password_field("person", "name")
)
end
@@ -71,7 +71,7 @@ class FormHelperTest < Test::Unit::TestCase
check_box("post", "secret")
)
assert_equal(
- '<input checked="checked" id="post_secret" name="post[secret]" type="checkbox" value="1" /><input name="post[secret]" type="hidden" value="0" />',
+ '<input checked="checked" id="post_secret" name="post[secret]" type="checkbox" value="1" /><input name="post[secret]" type="hidden" value="0" />',
check_box("post", "secret" ,{"checked"=>"checked"})
)
@post.secret = true
@@ -80,7 +80,7 @@ class FormHelperTest < Test::Unit::TestCase
check_box("post", "secret")
)
end
-
+
def test_check_box_with_explicit_checked_and_unchecked_values
@post.secret = "on"
assert_equal(
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index 7a666271c1..6295aa91b6 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -22,7 +22,7 @@ class FormTagHelperTest < Test::Unit::TestCase
end
def test_form_tag
- actual = form_tag
+ actual = form_tag
expected = %(<form action="http://www.example.com" method="post">)
assert_equal expected, actual
end
@@ -41,7 +41,7 @@ class FormTagHelperTest < Test::Unit::TestCase
def test_password_field_tag
actual = password_field_tag
- expected = %(<input id="password" name="password" type="password" value="" />)
+ expected = %(<input id="password" name="password" type="password" />)
assert_equal expected, actual
end
diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb
index fdcce49efa..a1fcdde16d 100644
--- a/actionpack/test/template/javascript_helper_test.rb
+++ b/actionpack/test/template/javascript_helper_test.rb
@@ -88,7 +88,7 @@ class JavaScriptHelperTest < Test::Unit::TestCase
def test_text_field_with_auto_complete
assert_match "<style>",
text_field_with_auto_complete(:message, :recipient)
- assert_equal %(<input autocomplete=\"off\" id=\"message_recipient\" name=\"message[recipient]\" size=\"30\" type=\"text\" value=\"\" /><div class=\"auto_complete\" id=\"message_recipient_auto_complete\"></div><script type=\"text/javascript\">new Ajax.Autocompleter('message_recipient', 'message_recipient_auto_complete', 'http://www.example.com/auto_complete_for_message_recipient', {})</script>),
+ assert_equal %(<input autocomplete=\"off\" id=\"message_recipient\" name=\"message[recipient]\" size=\"30\" type=\"text\" /><div class=\"auto_complete\" id=\"message_recipient_auto_complete\"></div><script type=\"text/javascript\">new Ajax.Autocompleter('message_recipient', 'message_recipient_auto_complete', 'http://www.example.com/auto_complete_for_message_recipient', {})</script>),
text_field_with_auto_complete(:message, :recipient, {}, :skip_style => true)
end
diff --git a/actionpack/test/template/tag_helper_test.rb b/actionpack/test/template/tag_helper_test.rb
index a3acdbcfd3..0c6783c158 100644
--- a/actionpack/test/template/tag_helper_test.rb
+++ b/actionpack/test/template/tag_helper_test.rb
@@ -16,6 +16,14 @@ class TagHelperTest < Test::Unit::TestCase
assert_equal "<p class=\"elsewhere\" />", tag("p", "class" => "show", :class => "elsewhere")
end
+ def test_tag_options_rejects_nil_option
+ assert_equal "<p />", tag("p", :ignored => nil)
+ end
+
+ def test_tag_options_accepts_blank_option
+ assert_equal "<p included=\"\" />", tag("p", :included => '')
+ end
+
def test_content_tag
assert_equal "<a href=\"create\">Create</a>", content_tag("a", "Create", "href" => "create")
assert_equal content_tag("a", "Create", "href" => "create"),