Merged r4064 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4134 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Eric Davis
2010-09-20 03:59:21 +00:00
parent 5a639173de
commit 00423307ce
2 changed files with 49 additions and 1 deletions
@@ -30,6 +30,35 @@ class ApplicationHelperTest < ActionView::TestCase
def setup
super
end
context "#link_to_if_authorized" do
context "authorized user" do
should "be tested"
end
context "unauthorized user" do
should "be tested"
end
should "allow using the :controller and :action for the target link" do
User.current = User.find_by_login('admin')
@project = Issue.first.project # Used by helper
response = link_to_if_authorized("By controller/action",
{:controller => 'issues', :action => 'edit', :id => Issue.first.id})
assert_match /href/, response
end
should "allow using the url for the target link" do
User.current = User.find_by_login('admin')
@project = Issue.first.project # Used by helper
response = link_to_if_authorized("By url",
new_issue_move_path(:id => Issue.first.id))
assert_match /href/, response
end
end
def test_auto_links
to_test = {