aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/tag_helper_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-09 17:28:35 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-09 17:28:35 +0000
commit2abe3d2cd92e5ee55c39f1b4062ccf60043105f7 (patch)
treec5ef25295bfef57c54fe5d957428c7422cdda23f /actionpack/test/template/tag_helper_test.rb
parent0fe8e3d6c28f64cf1e35bd129595cd79a7c77091 (diff)
downloadrails-2abe3d2cd92e5ee55c39f1b4062ccf60043105f7.tar.gz
rails-2abe3d2cd92e5ee55c39f1b4062ccf60043105f7.tar.bz2
rails-2abe3d2cd92e5ee55c39f1b4062ccf60043105f7.zip
Added that nil options are not included in tags, so tag("p", :ignore => nil) now returns <p /> not <p ignore="" /> but that tag("p", :ignore => "") still includes it #1465 [michael@schuerig.de]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1789 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/tag_helper_test.rb')
-rw-r--r--actionpack/test/template/tag_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
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"),