summaryrefslogtreecommitdiffstats
path: root/test/functional/users_controller_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-05-18 05:56:55 +0000
committerGo MAEDA <maeda@farend.jp>2024-05-18 05:56:55 +0000
commita9518e28b86a330cbbc2cd2c9170e1cd38c458e2 (patch)
tree0a89a098bd85c03c1eeadfd29beb72683afa30a1 /test/functional/users_controller_test.rb
parent58e9cd420adad1802d42828c8efedca0e6fed2d1 (diff)
downloadredmine-a9518e28b86a330cbbc2cd2c9170e1cd38c458e2.tar.gz
redmine-a9518e28b86a330cbbc2cd2c9170e1cd38c458e2.zip
Fix RuboCop offense Rails/HttpStatus (#39889).
git-svn-id: https://svn.redmine.org/redmine/trunk@22837 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/users_controller_test.rb')
-rw-r--r--test/functional/users_controller_test.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 387e965a5..4302f913a 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -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