このコミットが含まれているのは:
@@ -898,6 +898,22 @@ RSpec.describe 'Posts API', type: :request do
|
||||
expect(json.fetch('video_ms')).to eq(180_500)
|
||||
end
|
||||
|
||||
it 'creates a video post with number input duration seconds' do
|
||||
sign_in_as(member)
|
||||
|
||||
post '/posts', params: post_write_params(
|
||||
title: 'video post seconds',
|
||||
url: 'https://example.com/video-post-seconds',
|
||||
tags: '動画 spec_tag',
|
||||
duration: '180.5',
|
||||
thumbnail: dummy_upload
|
||||
)
|
||||
|
||||
expect(response).to have_http_status(:created)
|
||||
expect(Post.find(json.fetch('id')).video_ms).to eq(180_500)
|
||||
expect(json.fetch('video_ms')).to eq(180_500)
|
||||
end
|
||||
|
||||
it 'clears video_ms when the saved tags do not include 動画' do
|
||||
sign_in_as(member)
|
||||
|
||||
|
||||
新しい課題から参照
ユーザをブロックする