2005-03-09 13:53:47 +00:00
|
|
|
require File.dirname(__FILE__) + '/../abstract_unit'
|
|
|
|
|
2004-11-24 01:04:44 +00:00
|
|
|
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/tag_helper'
|
|
|
|
require File.dirname(__FILE__) + '/../../lib/action_view/helpers/url_helper'
|
|
|
|
|
|
|
|
class TagHelperTest < Test::Unit::TestCase
|
|
|
|
include ActionView::Helpers::TagHelper
|
|
|
|
include ActionView::Helpers::UrlHelper
|
|
|
|
|
|
|
|
def test_tag
|
|
|
|
assert_equal "<p class=\"show\" />", tag("p", "class" => "show")
|
2005-03-06 11:50:41 +00:00
|
|
|
assert_equal tag("p", "class" => "show"), tag("p", :class => "show")
|
2004-11-24 01:04:44 +00:00
|
|
|
end
|
2005-03-06 11:50:41 +00:00
|
|
|
|
2005-06-16 05:04:17 +00:00
|
|
|
def test_tag_options
|
|
|
|
assert_equal "<p class=\"elsewhere\" />", tag("p", "class" => "show", :class => "elsewhere")
|
|
|
|
end
|
|
|
|
|
2004-11-24 01:04:44 +00:00
|
|
|
def test_content_tag
|
|
|
|
assert_equal "<a href=\"create\">Create</a>", content_tag("a", "Create", "href" => "create")
|
2005-03-06 11:50:41 +00:00
|
|
|
assert_equal content_tag("a", "Create", "href" => "create"),
|
|
|
|
content_tag("a", "Create", :href => "create")
|
2004-11-24 01:04:44 +00:00
|
|
|
end
|
2005-03-06 11:50:41 +00:00
|
|
|
end
|