diff test/functional/gantts_controller_test.rb @ 511:107d36338b70 live

Merge from branch "cannam"
author Chris Cannam
date Thu, 14 Jul 2011 10:43:07 +0100
parents af80e5618e9b
children cbb26bc654de
line wrap: on
line diff
--- a/test/functional/gantts_controller_test.rb	Thu Jun 09 16:51:06 2011 +0100
+++ b/test/functional/gantts_controller_test.rb	Thu Jul 14 10:43:07 2011 +0100
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require File.expand_path('../../test_helper', __FILE__)
 
 class GanttsControllerTest < ActionController::TestCase
   fixtures :all
@@ -49,6 +49,18 @@
       assert_nil assigns(:gantt).project
     end
 
+    should "not disclose private projects" do
+      get :show
+      assert_response :success
+      assert_template 'show.html.erb'
+      
+      assert_tag 'a', :content => /eCookbook/
+      # Root private project
+      assert_no_tag 'a', {:content => /OnlineStore/}
+      # Private children of a public project
+      assert_no_tag 'a', :content => /Private child of eCookbook/
+    end
+
     should "export to pdf" do
       get :show, :project_id => 1, :format => 'pdf'
       assert_response :success