summaryrefslogtreecommitdiffstats
path: root/test/functional/projects_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-14 18:01:13 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-14 18:01:13 +0000
commit7ee38a95a0052ddc544137f32fcf9114e5ffabb9 (patch)
tree363d189e6aca2fd389c8f58ff58ed96e35fdcd6a /test/functional/projects_controller_test.rb
parent06e44b8e643797c8d5a11478ef6605f49c7220e0 (diff)
downloadredmine-7ee38a95a0052ddc544137f32fcf9114e5ffabb9.tar.gz
redmine-7ee38a95a0052ddc544137f32fcf9114e5ffabb9.zip
Fixed: Calendar and Gantt show private subprojects even if current user is not a member of them (#1217).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1431 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/projects_controller_test.rb')
-rw-r--r--test/functional/projects_controller_test.rb25
1 files changed, 23 insertions, 2 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 5af7b5572..bebe96f29 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -29,6 +29,7 @@ class ProjectsControllerTest < Test::Unit::TestCase
@controller = ProjectsController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
+ @request.session[:user_id] = nil
end
def test_index
@@ -237,11 +238,21 @@ class ProjectsControllerTest < Test::Unit::TestCase
assert_not_nil assigns(:calendar)
end
- def test_calendar_with_subprojects
+ def test_calendar_with_subprojects_should_not_show_private_subprojects
get :calendar, :id => 1, :with_subprojects => 1, :tracker_ids => [1, 2]
assert_response :success
assert_template 'calendar'
assert_not_nil assigns(:calendar)
+ assert_no_tag :tag => 'a', :content => /#6/
+ end
+
+ def test_calendar_with_subprojects_should_show_private_subprojects
+ @request.session[:user_id] = 2
+ get :calendar, :id => 1, :with_subprojects => 1, :tracker_ids => [1, 2]
+ assert_response :success
+ assert_template 'calendar'
+ assert_not_nil assigns(:calendar)
+ assert_tag :tag => 'a', :content => /#6/
end
def test_gantt
@@ -251,13 +262,23 @@ class ProjectsControllerTest < Test::Unit::TestCase
assert_not_nil assigns(:events)
end
- def test_gantt_with_subprojects
+ def test_gantt_with_subprojects_should_not_show_private_subprojects
get :gantt, :id => 1, :with_subprojects => 1, :tracker_ids => [1, 2]
assert_response :success
assert_template 'gantt.rhtml'
assert_not_nil assigns(:events)
+ assert_no_tag :tag => 'a', :content => /#6/
end
+ def test_gantt_with_subprojects_should_show_private_subprojects
+ @request.session[:user_id] = 2
+ get :gantt, :id => 1, :with_subprojects => 1, :tracker_ids => [1, 2]
+ assert_response :success
+ assert_template 'gantt.rhtml'
+ assert_not_nil assigns(:events)
+ assert_tag :tag => 'a', :content => /#6/
+ end
+
def test_gantt_export_to_pdf
get :gantt, :id => 1, :format => 'pdf'
assert_response :success