このコミットが含まれているのは:
@@ -898,6 +898,22 @@ RSpec.describe 'Posts API', type: :request do
|
|||||||
expect(json.fetch('video_ms')).to eq(180_500)
|
expect(json.fetch('video_ms')).to eq(180_500)
|
||||||
end
|
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
|
it 'clears video_ms when the saved tags do not include 動画' do
|
||||||
sign_in_as(member)
|
sign_in_as(member)
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ describe ('posts API functions', () => {
|
|||||||
id: 5,
|
id: 5,
|
||||||
title: 'new title',
|
title: 'new title',
|
||||||
tags: 'tag',
|
tags: 'tag',
|
||||||
|
duration: null,
|
||||||
parentPostIds: '1 2',
|
parentPostIds: '1 2',
|
||||||
originalCreatedFrom: null,
|
originalCreatedFrom: null,
|
||||||
originalCreatedBefore: '2026-01-02T00:00:00Z',
|
originalCreatedBefore: '2026-01-02T00:00:00Z',
|
||||||
@@ -82,6 +83,7 @@ describe ('posts API functions', () => {
|
|||||||
{
|
{
|
||||||
title: 'new title',
|
title: 'new title',
|
||||||
tags: 'tag',
|
tags: 'tag',
|
||||||
|
duration: null,
|
||||||
parent_post_ids: '1 2',
|
parent_post_ids: '1 2',
|
||||||
original_created_from: null,
|
original_created_from: null,
|
||||||
original_created_before: '2026-01-02T00:00:00Z',
|
original_created_before: '2026-01-02T00:00:00Z',
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ const weights = buildTheatrePostSelectionWeights ({
|
|||||||
tags: [],
|
tags: [],
|
||||||
}],
|
}],
|
||||||
})
|
})
|
||||||
|
const watchingUsers = [
|
||||||
|
{ id: 1, name: 'tester' },
|
||||||
|
{ id: 2, name: 'another' },
|
||||||
|
]
|
||||||
|
|
||||||
const renderPage = (user = buildUser ({ id: 1, role: 'member' })) =>
|
const renderPage = (user = buildUser ({ id: 1, role: 'member' })) =>
|
||||||
renderWithProviders (
|
renderWithProviders (
|
||||||
@@ -136,11 +140,11 @@ const mockDefaultApi = () => {
|
|||||||
postId: currentPost.id,
|
postId: currentPost.id,
|
||||||
postStartedAt: '2026-01-02T03:04:05.000Z',
|
postStartedAt: '2026-01-02T03:04:05.000Z',
|
||||||
postElapsedMs: 1_000,
|
postElapsedMs: 1_000,
|
||||||
watchingUsers: [{ id: 1, name: 'tester' }],
|
watchingUsers,
|
||||||
skipVote: {
|
skipVote: {
|
||||||
votesCount: 0,
|
votesCount: 0,
|
||||||
requiredCount: 2,
|
requiredCount: 2,
|
||||||
watchingUsersCount: 1,
|
watchingUsersCount: watchingUsers.length,
|
||||||
voted: false,
|
voted: false,
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
@@ -150,11 +154,11 @@ const mockDefaultApi = () => {
|
|||||||
postId: currentPost.id,
|
postId: currentPost.id,
|
||||||
postStartedAt: '2026-01-02T03:04:05.000Z',
|
postStartedAt: '2026-01-02T03:04:05.000Z',
|
||||||
postElapsedMs: 2_000,
|
postElapsedMs: 2_000,
|
||||||
watchingUsers: [{ id: 1, name: 'tester' }],
|
watchingUsers,
|
||||||
skipVote: {
|
skipVote: {
|
||||||
votesCount: 1,
|
votesCount: 1,
|
||||||
requiredCount: 2,
|
requiredCount: 2,
|
||||||
watchingUsersCount: 1,
|
watchingUsersCount: watchingUsers.length,
|
||||||
voted: true,
|
voted: true,
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
|
|||||||
+4
-3
@@ -356,6 +356,7 @@ export type Tag = {
|
|||||||
hasWiki: boolean
|
hasWiki: boolean
|
||||||
materialId: number | null
|
materialId: number | null
|
||||||
hasDeerjikists: boolean
|
hasDeerjikists: boolean
|
||||||
|
children?: Tag[]
|
||||||
matchedAlias?: string | null }
|
matchedAlias?: string | null }
|
||||||
|
|
||||||
export type TagVersion = {
|
export type TagVersion = {
|
||||||
@@ -370,9 +371,9 @@ export type TagVersion = {
|
|||||||
createdAt: string
|
createdAt: string
|
||||||
createdByUser: { id: number; name: string | null } | null }
|
createdByUser: { id: number; name: string | null } | null }
|
||||||
|
|
||||||
export type TagWithSections = Tag & { sections: { beginMs: number
|
export type TagWithSections = Omit<Tag, 'children'> & { sections: { beginMs: number
|
||||||
endMs: number | null }[]
|
endMs: number | null }[]
|
||||||
children: TagWithSections[] }
|
children: TagWithSections[] }
|
||||||
|
|
||||||
export type Theatre = {
|
export type Theatre = {
|
||||||
id: number
|
id: number
|
||||||
|
|||||||
新しい課題から参照
ユーザをブロックする