このコミットが含まれているのは:
2026-07-16 19:35:21 +09:00
コミット d1de631eed
11個のファイルの変更396行の追加37行の削除
+2
ファイルの表示
@@ -109,6 +109,8 @@ RSpec.describe 'Post imports API', type: :request do
expect(json.fetch('rows').first.fetch('validation_errors')).to include(
'original_created_from' => ['オリジナルの作成日時は分単位で入力してください.']
)
expect(json.fetch('rows').first.fetch('validation_errors'))
.not_to have_key('original_created_at')
end
end
+7 -5
ファイルの表示
@@ -2221,6 +2221,7 @@ RSpec.describe 'Posts API', type: :request do
expect(json.fetch('errors')).to include(
'original_created_from' => ['オリジナルの作成日時は分単位で入力してください.']
)
expect(json.fetch('errors')).not_to have_key('original_created_at')
end
it 'rejects fractional-second original created timestamps on POST /posts' do
@@ -2237,22 +2238,23 @@ RSpec.describe 'Posts API', type: :request do
expect(json.fetch('errors')).to include(
'original_created_before' => ['オリジナルの作成日時は分単位で入力してください.']
)
expect(json.fetch('errors')).not_to have_key('original_created_at')
end
it 'rejects original created ranges shorter than one minute on POST /posts' do
it 'rejects non-increasing original created ranges on POST /posts' do
sign_in_as(member)
post '/posts', params: post_write_params(
title: 'too short original created range',
url: 'https://example.com/too-short-original-created-range',
title: 'non-increasing original created range',
url: 'https://example.com/non-increasing-original-created-range',
tags: 'spec_tag',
thumbnail: dummy_upload,
original_created_from: '2020-01-01T00:00Z',
original_created_before: '2020-01-01T00:00:30Z')
original_created_before: '2020-01-01T00:00Z')
expect(response).to have_http_status(:unprocessable_entity)
expect(json.fetch('errors')).to include(
'original_created_at' => ['オリジナルの作成日時の範囲は1分以上必要です.']
'original_created_at' => ['オリジナルの作成日時の順番がをかしぃです.']
)
end