summaryrefslogtreecommitdiffstats
path: root/test/unit/helpers
diff options
context:
space:
mode:
authorJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2010-08-08 07:07:20 +0000
committerJean-Baptiste Barth <jeanbaptiste.barth@gmail.com>2010-08-08 07:07:20 +0000
commita1b607480abc6649f9531b1fd8a7d20c3c656084 (patch)
treec23e04bd9922308d8c00f9e3962a02bdcb120248 /test/unit/helpers
parent5b64f0ff969db3f0a99c1c780ab03d842da6b59d (diff)
downloadredmine-a1b607480abc6649f9531b1fd8a7d20c3c656084.tar.gz
redmine-a1b607480abc6649f9531b1fd8a7d20c3c656084.zip
Refactor: added link_to_project helper to handle links to projects
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3924 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/helpers')
-rw-r--r--test/unit/helpers/application_helper_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb
index 90d342898..6fd21fe37 100644
--- a/test/unit/helpers/application_helper_test.rb
+++ b/test/unit/helpers/application_helper_test.rb
@@ -597,4 +597,16 @@ EXPECTED
t = link_to_user(user)
assert_equal ::I18n.t(:label_user_anonymous), t
end
+
+ def test_link_to_project
+ project = Project.find(1)
+ assert_equal %(<a href="/projects/ecookbook">eCookbook</a>),
+ link_to_project(project)
+ assert_equal %(<a href="/projects/ecookbook/settings">eCookbook</a>),
+ link_to_project(project, :action => 'settings')
+ assert_equal %(<a href="http://test.host/projects/ecookbook?jump=blah">eCookbook</a>),
+ link_to_project(project, {:only_path => false, :jump => 'blah'})
+ assert_equal %(<a href="/projects/ecookbook/settings" class="project">eCookbook</a>),
+ link_to_project(project, {:action => 'settings'}, :class => "project")
+ end
end