summaryrefslogtreecommitdiffstats
path: root/test/functional/projects_controller_test.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-06-20 16:29:12 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-06-20 16:29:12 +0000
commit116c7a7964d6bd8842a11d48ec9e7995d931e710 (patch)
tree3c114c4880ac8e0a3ef149f349947888b40da36f /test/functional/projects_controller_test.rb
parent4083e7e62270186d61782eec7e5861cee89e2619 (diff)
downloadredmine-116c7a7964d6bd8842a11d48ec9e7995d931e710.tar.gz
redmine-116c7a7964d6bd8842a11d48ec9e7995d931e710.zip
Add a link to the cross project time entries page to /projects. #4935
Contributed by Jan. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3802 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/projects_controller_test.rb')
-rw-r--r--test/functional/projects_controller_test.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index ac639d737..988496cec 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -60,6 +60,33 @@ class ProjectsControllerTest < ActionController::TestCase
assert_select 'feed>entry', :count => Project.count(:conditions => Project.visible_by(User.current))
end
+ context "#index" do
+ context "by non-admin user with view_time_entries permission" do
+ setup do
+ @request.session[:user_id] = 3
+ end
+ should "show overall spent time link" do
+ get :index
+ assert_template 'index'
+ assert_tag :a, :attributes => {:href => '/time_entries'}
+ end
+ end
+
+ context "by non-admin user without view_time_entries permission" do
+ setup do
+ Role.find(2).remove_permission! :view_time_entries
+ Role.non_member.remove_permission! :view_time_entries
+ Role.anonymous.remove_permission! :view_time_entries
+ @request.session[:user_id] = 3
+ end
+ should "not show overall spent time link" do
+ get :index
+ assert_template 'index'
+ assert_no_tag :a, :attributes => {:href => '/time_entries'}
+ end
+ end
+ end
+
context "#add" do
context "by admin user" do
setup do