Mercurial > hg > soundsoftware-site
diff test/unit/helpers/.svn/text-base/application_helper_test.rb.svn-base @ 25:9fd6221709a6 luisf
* Merge cannam branch
author | Chris Cannam |
---|---|
date | Fri, 24 Sep 2010 15:51:28 +0100 |
parents | 40f7cfd4df19 |
children | 94944d00e43c |
line wrap: on
line diff
--- a/test/unit/helpers/.svn/text-base/application_helper_test.rb.svn-base Fri Sep 24 15:33:13 2010 +0100 +++ b/test/unit/helpers/.svn/text-base/application_helper_test.rb.svn-base Fri Sep 24 15:51:28 2010 +0100 @@ -17,10 +17,7 @@ require File.dirname(__FILE__) + '/../../test_helper' -class ApplicationHelperTest < HelperTestCase - include ApplicationHelper - include ActionView::Helpers::TextHelper - include ActionView::Helpers::DateHelper +class ApplicationHelperTest < ActionView::TestCase fixtures :projects, :roles, :enabled_modules, :users, :repositories, :changesets, @@ -33,6 +30,35 @@ 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 = { @@ -575,7 +601,7 @@ # turn off avatars Setting.gravatar_enabled = '0' - assert_nil avatar(User.find_by_mail('jsmith@somenet.foo')) + assert_equal '', avatar(User.find_by_mail('jsmith@somenet.foo')) end def test_link_to_user