diff options
Diffstat (limited to 'actionpack/test/template/url_helper_test.rb')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 198b26b113..e624c188db 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -27,6 +27,18 @@ class UrlHelperTest < Test::Unit::TestCase ) end + def test_link_to_image + assert_equal( + "<a href=\"http://www.world.com\"><img alt=\"Rss\" height=\"45\" src=\"/images/rss.png\" width=\"30\" /></a>", + link_to_image("rss", "http://www.world.com", "size" => "30x45") + ) + + assert_equal( + "<a class=\"admin\" href=\"http://www.world.com\"><img alt=\"Feed\" height=\"45\" src=\"/images/rss.gif\" width=\"30\" /></a>", + link_to_image("rss.gif", "http://www.world.com", "size" => "30x45", "alt" => "Feed", "class" => "admin") + ) + end + def test_link_unless_current @params = { "controller" => "weblog", "action" => "show"} assert_equal "Showing", link_to_unless_current("Showing", :action => "show", :controller => "weblog") |