Fix RuboCop offense Rails/HttpStatus (#39889).

git-svn-id: https://svn.redmine.org/redmine/trunk@22837 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-05-18 05:56:55 +00:00
parent 58e9cd420a
commit a9518e28b8
83 changed files with 376 additions and 398 deletions

View File

@@ -335,13 +335,13 @@ class UsersControllerTest < Redmine::ControllerTest
def test_show_inactive
@request.session[:user_id] = nil
get :show, :params => {:id => 5}
assert_response 404
assert_response :not_found
end
def test_show_inactive_by_admin
@request.session[:user_id] = 1
get :show, :params => {:id => 5}
assert_response 200
assert_response :ok
assert_select 'h2', :text => /Dave2 Lopper2/
end
@@ -351,7 +351,7 @@ class UsersControllerTest < Redmine::ControllerTest
@request.session[:user_id] = nil
get :show, :params => {:id => user.id}
assert_response 404
assert_response :not_found
end
def test_show_displays_memberships_based_on_project_visibility
@@ -378,7 +378,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_show_current_should_require_authentication
@request.session[:user_id] = nil
get :show, :params => {:id => 'current'}
assert_response 302
assert_response :found
end
def test_show_current
@@ -656,7 +656,7 @@ class UsersControllerTest < Redmine::ControllerTest
get :edit, :params => {:id => 6}
assert_response 404
assert_response :not_found
end
def test_edit_user_with_full_text_formatting_custom_field_should_not_fail
@@ -857,7 +857,7 @@ class UsersControllerTest < Redmine::ControllerTest
:id => 2,
:user => {:status => 3}
}
assert_response 302
assert_response :found
user = User.find(2)
assert_equal 3, user.status
assert_equal '1', user.pref[:no_self_notified]
@@ -997,7 +997,7 @@ class UsersControllerTest < Redmine::ControllerTest
def test_update_should_be_denied_for_anonymous
assert User.find(6).anonymous?
put :update, :params => {:id => 6}
assert_response 404
assert_response :not_found
end
def test_update_with_blank_email_should_not_raise_exception
@@ -1051,7 +1051,7 @@ class UsersControllerTest < Redmine::ControllerTest
assert_no_difference 'User.count' do
delete :destroy, :params => {:id => 2, :confirm => User.find(2).login}
end
assert_response 403
assert_response :forbidden
end
def test_destroy_should_be_denied_for_anonymous
@@ -1059,7 +1059,7 @@ class UsersControllerTest < Redmine::ControllerTest
assert_no_difference 'User.count' do
delete :destroy, :params => {:id => 6, :confirm => User.find(6).login}
end
assert_response 404
assert_response :not_found
end
def test_destroy_should_redirect_to_back_url_param
@@ -1105,7 +1105,7 @@ class UsersControllerTest < Redmine::ControllerTest
assert_no_difference 'User.count' do
delete :destroy, params: {id: user.id}
end
assert_response 422
assert_response :unprocessable_entity
end
end
@@ -1116,7 +1116,7 @@ class UsersControllerTest < Redmine::ControllerTest
assert_no_difference 'User.count' do
delete :destroy, params: {id: user.id}
end
assert_response 422
assert_response :unprocessable_entity
end
end
@@ -1166,7 +1166,7 @@ class UsersControllerTest < Redmine::ControllerTest
assert_no_difference 'User.count' do
delete :bulk_destroy, :params => {:ids => [2], :confirm => 'Yes'}
end
assert_response 403
assert_response :forbidden
end
def test_bulk_destroy_should_be_denied_for_anonymous
@@ -1174,6 +1174,6 @@ class UsersControllerTest < Redmine::ControllerTest
assert_no_difference 'User.count' do
delete :bulk_destroy, :params => {:ids => [6], :confirm => "Yes"}
end
assert_response 404
assert_response :not_found
end
end