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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user