Merged r1385 and r1426 to r1434 from trunk.
git-svn-id: http://redmine.rubyforge.org/svn/branches/0.7-stable@1437 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -53,13 +53,44 @@ class IssuesControllerTest < Test::Unit::TestCase
|
||||
assert_template 'index.rhtml'
|
||||
assert_not_nil assigns(:issues)
|
||||
assert_nil assigns(:project)
|
||||
assert_tag :tag => 'a', :content => /Can't print recipes/
|
||||
assert_tag :tag => 'a', :content => /Subproject issue/
|
||||
# private projects hidden
|
||||
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
|
||||
assert_no_tag :tag => 'a', :content => /Issue on project 2/
|
||||
end
|
||||
|
||||
def test_index_with_project
|
||||
Setting.display_subprojects_issues = 0
|
||||
get :index, :project_id => 1
|
||||
assert_response :success
|
||||
assert_template 'index.rhtml'
|
||||
assert_not_nil assigns(:issues)
|
||||
assert_tag :tag => 'a', :content => /Can't print recipes/
|
||||
assert_no_tag :tag => 'a', :content => /Subproject issue/
|
||||
end
|
||||
|
||||
def test_index_with_project_and_subprojects
|
||||
Setting.display_subprojects_issues = 1
|
||||
get :index, :project_id => 1
|
||||
assert_response :success
|
||||
assert_template 'index.rhtml'
|
||||
assert_not_nil assigns(:issues)
|
||||
assert_tag :tag => 'a', :content => /Can't print recipes/
|
||||
assert_tag :tag => 'a', :content => /Subproject issue/
|
||||
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
|
||||
end
|
||||
|
||||
def test_index_with_project_and_subprojects_should_show_private_subprojects
|
||||
@request.session[:user_id] = 2
|
||||
Setting.display_subprojects_issues = 1
|
||||
get :index, :project_id => 1
|
||||
assert_response :success
|
||||
assert_template 'index.rhtml'
|
||||
assert_not_nil assigns(:issues)
|
||||
assert_tag :tag => 'a', :content => /Can't print recipes/
|
||||
assert_tag :tag => 'a', :content => /Subproject issue/
|
||||
assert_tag :tag => 'a', :content => /Issue of a private subproject/
|
||||
end
|
||||
|
||||
def test_index_with_project_and_filter
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user