AI: address review on PR #481

このコミットが含まれているのは:
Codex Night Worker
2026-11-23 04:56:44 +09:00
コミット c9711652d7
26個のファイルの変更、82行の追加、82行の削除
+24 -24
ファイルの表示
@@ -1120,7 +1120,7 @@ RSpec.describe 'Posts API', type: :request do
get '/posts/metadata', params: { url: 'file:///etc/passwd' }
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to have_key('url')
end
end
@@ -1258,7 +1258,7 @@ RSpec.describe 'Posts API', type: :request do
)
}.not_to change(Post, :count)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'thumbnail' => ['サムネイル画像の変換に失敗しました.']
)
@@ -1297,7 +1297,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload
)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'tags' => ['廃止済みタグがあります: deprecated_direct_tag']
)
@@ -1343,7 +1343,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload
)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json).to include(
'type' => 'validation_error',
'message' => '入力内容を確認してください.'
@@ -1411,7 +1411,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload
)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'video_ms' => ['タグ区間の終端が動画時間を超えてゐます.']
)
@@ -1522,7 +1522,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload
)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'video_ms' => ['タグ区間の開始が動画時間以上です.']
)
@@ -1543,7 +1543,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload
)
expect(response).to have_http_status(:unprocessable_entity), response.body
expect(response).to have_http_status(:unprocessable_content), response.body
expect(json).to include(
'type' => 'validation_error',
'message' => '入力内容を確認してください.',
@@ -1563,7 +1563,7 @@ RSpec.describe 'Posts API', type: :request do
tags: 'spec_tag', # 既存タグ名を投げる
thumbnail: dummy_upload)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end
end
@@ -1577,7 +1577,7 @@ RSpec.describe 'Posts API', type: :request do
tags: 'spec_tag', # 既存タグ名を投げる
thumbnail: dummy_upload)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end
end
@@ -1679,7 +1679,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload }
}.not_to change(Post, :count)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to be_present
end
end
@@ -1698,7 +1698,7 @@ RSpec.describe 'Posts API', type: :request do
)
}.not_to change(Post, :count)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to be_present
end
end
@@ -1717,7 +1717,7 @@ RSpec.describe 'Posts API', type: :request do
)
}.not_to change(PostImplication, :count)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to be_present
end
end
@@ -1848,7 +1848,7 @@ RSpec.describe 'Posts API', type: :request do
tags: 'deprecated_update_tag'
)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'tags' => ['廃止済みタグは付与できません.']
)
@@ -1867,7 +1867,7 @@ RSpec.describe 'Posts API', type: :request do
title: 'updated title',
tags: 'nico:nico_tag')
expect(response).to have_http_status(:unprocessable_entity), response.body
expect(response).to have_http_status(:unprocessable_content), response.body
expect(json).to include(
'type' => 'validation_error',
'message' => '入力内容を確認してください.',
@@ -1974,7 +1974,7 @@ RSpec.describe 'Posts API', type: :request do
title: 'updated title',
tags: 'spec_tag' }
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to be_present
end
end
@@ -2000,7 +2000,7 @@ RSpec.describe 'Posts API', type: :request do
parent_post_ids: 'abc'
)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(post_record.reload.parent_posts.pluck(:id)).to eq([parent_post.id])
end
end
@@ -2026,7 +2026,7 @@ RSpec.describe 'Posts API', type: :request do
parent_post_ids: '999999999'
)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(post_record.reload.parent_posts.pluck(:id)).to eq([parent_post.id])
end
end
@@ -2042,7 +2042,7 @@ RSpec.describe 'Posts API', type: :request do
parent_post_ids: post_record.id.to_s
)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(PostImplication.exists?(
post_id: post_record.id,
@@ -2762,7 +2762,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload)
end.not_to change(PostVersion, :count)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end
it 'does not create a version when PUT /posts/:id is invalid' do
@@ -2778,7 +2778,7 @@ RSpec.describe 'Posts API', type: :request do
original_created_before: Time.zone.local(2020, 1, 1, 0, 0, 0).iso8601)
end.not_to change(PostVersion, :count)
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
end
it 'rejects second-bearing original created timestamps on POST /posts' do
@@ -2791,7 +2791,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload,
original_created_from: '2020-01-01T00:00:01Z')
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'original_created_from' => ['オリジナルの作成日時は分単位で入力してください.']
)
@@ -2808,7 +2808,7 @@ RSpec.describe 'Posts API', type: :request do
thumbnail: dummy_upload,
original_created_before: '2020-01-01T00:00:00.123Z')
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'original_created_before' => ['オリジナルの作成日時は分単位で入力してください.']
)
@@ -2826,7 +2826,7 @@ RSpec.describe 'Posts API', type: :request do
original_created_from: '2020-01-01T00:00Z',
original_created_before: '2020-01-01T00:00Z')
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'original_created_at' => ['オリジナルの作成日時の順番がをかしぃです.']
)
@@ -2860,7 +2860,7 @@ RSpec.describe 'Posts API', type: :request do
tags: 'spec_tag',
original_created_from: 'not-a-time')
expect(response).to have_http_status(:unprocessable_entity)
expect(response).to have_http_status(:unprocessable_content)
expect(json.fetch('errors')).to include(
'original_created_from' => ['オリジナルの作成日時の形式が不正です.']
)