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

@@ -61,7 +61,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
test "GET /attachments/:id.xml should deny access without credentials" do
get '/attachments/7.xml'
assert_response 401
assert_response :unauthorized
end
test "GET /attachments/download/:id/:filename should return the attachment content" do
@@ -72,7 +72,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
test "GET /attachments/download/:id/:filename should deny access without credentials" do
get '/attachments/download/7/archive.zip'
assert_response 401
assert_response :unauthorized
end
test "GET /attachments/thumbnail/:id should return the thumbnail" do
@@ -118,7 +118,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
:params => {:attachment => {:filename => '', :description => 'updated'}},
:headers => credentials('jsmith')
)
assert_response 422
assert_response :unprocessable_entity
assert_equal 'application/json', response.media_type
json = ActiveSupport::JSON.decode(response.body)
assert_include "File cannot be blank", json['errors']
@@ -209,7 +209,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
"CONTENT_TYPE" => 'image/png'
}.merge(credentials('jsmith'))
)
assert_response 406
assert_response :not_acceptable
end
end
@@ -224,7 +224,7 @@ class Redmine::ApiTest::AttachmentsTest < Redmine::ApiTest::Base
"CONTENT_TYPE" => 'application/octet-stream'
}.merge(credentials('jsmith'))
)
assert_response 422
assert_response :unprocessable_entity
assert_select 'error', :text => /exceeds the maximum allowed file size/
end
end