@@ -1026,7 +1026,7 class IssuesControllerTest < ActionController::TestCase | |||||
1026 | end |
|
1026 | end | |
1027 |
|
1027 | |||
1028 | def test_show_should_deny_anonymous_access_to_private_issue |
|
1028 | def test_show_should_deny_anonymous_access_to_private_issue | |
1029 |
Issue.update_all(["is_private = ?", true] |
|
1029 | Issue.where(:id => 1).update_all(["is_private = ?", true]) | |
1030 | get :show, :id => 1 |
|
1030 | get :show, :id => 1 | |
1031 | assert_response :redirect |
|
1031 | assert_response :redirect | |
1032 | end |
|
1032 | end | |
@@ -1039,7 +1039,7 class IssuesControllerTest < ActionController::TestCase | |||||
1039 | end |
|
1039 | end | |
1040 |
|
1040 | |||
1041 | def test_show_should_deny_non_member_access_to_private_issue |
|
1041 | def test_show_should_deny_non_member_access_to_private_issue | |
1042 |
Issue.update_all(["is_private = ?", true] |
|
1042 | Issue.where(:id => 1).update_all(["is_private = ?", true]) | |
1043 | @request.session[:user_id] = 9 |
|
1043 | @request.session[:user_id] = 9 | |
1044 | get :show, :id => 1 |
|
1044 | get :show, :id => 1 | |
1045 | assert_response 403 |
|
1045 | assert_response 403 | |
@@ -1053,28 +1053,28 class IssuesControllerTest < ActionController::TestCase | |||||
1053 | end |
|
1053 | end | |
1054 |
|
1054 | |||
1055 | def test_show_should_deny_member_access_to_private_issue_without_permission |
|
1055 | def test_show_should_deny_member_access_to_private_issue_without_permission | |
1056 |
Issue.update_all(["is_private = ?", true] |
|
1056 | Issue.where(:id => 1).update_all(["is_private = ?", true]) | |
1057 | @request.session[:user_id] = 3 |
|
1057 | @request.session[:user_id] = 3 | |
1058 | get :show, :id => 1 |
|
1058 | get :show, :id => 1 | |
1059 | assert_response 403 |
|
1059 | assert_response 403 | |
1060 | end |
|
1060 | end | |
1061 |
|
1061 | |||
1062 | def test_show_should_allow_author_access_to_private_issue |
|
1062 | def test_show_should_allow_author_access_to_private_issue | |
1063 |
Issue.update_all(["is_private = ?, author_id = 3", true] |
|
1063 | Issue.where(:id => 1).update_all(["is_private = ?, author_id = 3", true]) | |
1064 | @request.session[:user_id] = 3 |
|
1064 | @request.session[:user_id] = 3 | |
1065 | get :show, :id => 1 |
|
1065 | get :show, :id => 1 | |
1066 | assert_response :success |
|
1066 | assert_response :success | |
1067 | end |
|
1067 | end | |
1068 |
|
1068 | |||
1069 | def test_show_should_allow_assignee_access_to_private_issue |
|
1069 | def test_show_should_allow_assignee_access_to_private_issue | |
1070 |
Issue.update_all(["is_private = ?, assigned_to_id = 3", true] |
|
1070 | Issue.where(:id => 1).update_all(["is_private = ?, assigned_to_id = 3", true]) | |
1071 | @request.session[:user_id] = 3 |
|
1071 | @request.session[:user_id] = 3 | |
1072 | get :show, :id => 1 |
|
1072 | get :show, :id => 1 | |
1073 | assert_response :success |
|
1073 | assert_response :success | |
1074 | end |
|
1074 | end | |
1075 |
|
1075 | |||
1076 | def test_show_should_allow_member_access_to_private_issue_with_permission |
|
1076 | def test_show_should_allow_member_access_to_private_issue_with_permission | |
1077 |
Issue.update_all(["is_private = ?", true] |
|
1077 | Issue.where(:id => 1).update_all(["is_private = ?", true]) | |
1078 | User.find(3).roles_for_project(Project.find(1)).first.update_attribute :issues_visibility, 'all' |
|
1078 | User.find(3).roles_for_project(Project.find(1)).first.update_attribute :issues_visibility, 'all' | |
1079 | @request.session[:user_id] = 3 |
|
1079 | @request.session[:user_id] = 3 | |
1080 | get :show, :id => 1 |
|
1080 | get :show, :id => 1 |
General Comments 0
You need to be logged in to leave comments.
Login now