diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-09 23:18:25 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-09 23:18:25 +0000 |
commit | e1917cab3249e7341160bce66f90b5ec52e14733 (patch) | |
tree | 57fa146ffa9454100ddf02cf3fd04dfe81e9597c /actionpack/test | |
parent | bf33b6ccaec2b9de38af804c8ac1e00310a8622d (diff) | |
download | rails-e1917cab3249e7341160bce66f90b5ec52e14733.tar.gz rails-e1917cab3249e7341160bce66f90b5ec52e14733.tar.bz2 rails-e1917cab3249e7341160bce66f90b5ec52e14733.zip |
Added link_to_image(src, options = {}, html_options = {}, *parameters_for_method_reference)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@105 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-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") |