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

@@ -179,7 +179,7 @@ class WikiControllerTest < Redmine::ControllerTest
def test_show_unexistent_page_without_edit_right
get :show, :params => {:project_id => 1, :id => 'Unexistent page'}
assert_response 404
assert_response :not_found
end
def test_show_unexistent_page_with_edit_right
@@ -191,7 +191,7 @@ class WikiControllerTest < Redmine::ControllerTest
def test_show_specific_version_of_an_unexistent_page_without_edit_right
get :show, :params => {:project_id => 1, :id => 'Unexistent page', :version => 1}
assert_response 404
assert_response :not_found
end
def test_show_unexistent_page_with_parent_should_preselect_parent
@@ -204,14 +204,14 @@ class WikiControllerTest < Redmine::ControllerTest
def test_show_unexistent_version_page
@request.session[:user_id] = 2
get :show, :params => {:project_id => 1, :id => 'CookBook_documentation', :version => 100}
assert_response 404
assert_response :not_found
end
def test_show_should_not_show_history_without_permission
Role.anonymous.remove_permission! :view_wiki_edits
get :show, :params => {:project_id => 1, :id => 'Page with sections', :version => 2}
assert_response 302
assert_response :found
end
def test_show_page_without_content_should_display_the_edit_form
@@ -386,7 +386,7 @@ class WikiControllerTest < Redmine::ControllerTest
@request.session[:user_id] = 2
get :edit, :params => {:project_id => 'ecookbook', :id => 'Page_with_sections', :section => 10}
assert_response 404
assert_response :not_found
end
def test_update_page
@@ -598,7 +598,7 @@ class WikiControllerTest < Redmine::ControllerTest
:id => 'NoContent',
:content => {:text => 'Some content'}
}
assert_response 302
assert_response :found
end
end
assert_equal 'Some content', page.reload.content.text
@@ -780,7 +780,7 @@ class WikiControllerTest < Redmine::ControllerTest
:project_id => 1, :id => 'CookBook_documentation',
:version => '99'
}
assert_response 404
assert_response :not_found
end
def test_diff_with_invalid_version_from_should_respond_with_404
@@ -789,7 +789,7 @@ class WikiControllerTest < Redmine::ControllerTest
:version => '99',
:version_from => '98'
}
assert_response 404
assert_response :not_found
end
def test_annotate
@@ -825,7 +825,7 @@ class WikiControllerTest < Redmine::ControllerTest
:project_id => 1, :id => 'CookBook_documentation',
:version => '99'
}
assert_response 404
assert_response :not_found
end
def test_get_rename
@@ -1040,7 +1040,7 @@ class WikiControllerTest < Redmine::ControllerTest
end
end
end
assert_response 404
assert_response :not_found
end
def test_index
@@ -1097,7 +1097,7 @@ class WikiControllerTest < Redmine::ControllerTest
Role.find_by_name('Manager').remove_permission! :export_wiki_pages
get :export, :params => {:project_id => 'ecookbook'}
assert_response 403
assert_response :forbidden
end
def test_date_index
@@ -1110,7 +1110,7 @@ class WikiControllerTest < Redmine::ControllerTest
def test_not_found
get :show, :params => {:project_id => 999}
assert_response 404
assert_response :not_found
end
def test_protect_page
@@ -1237,7 +1237,7 @@ class WikiControllerTest < Redmine::ControllerTest
# Non members cannot edit protected wiki pages
@request.session[:user_id] = 4
get :edit, :params => {:project_id => 1, :id => 'CookBook_documentation'}
assert_response 403
assert_response :forbidden
end
def test_edit_protected_page_by_member
@@ -1248,7 +1248,7 @@ class WikiControllerTest < Redmine::ControllerTest
def test_history_of_non_existing_page_should_return_404
get :history, :params => {:project_id => 1, :id => 'Unknown_page'}
assert_response 404
assert_response :not_found
end
def test_add_attachment