【再掲】タグの局所記載 (#351) #380

マージ済み
みてるぞ が 10 個のコミットを feature/351 から main へマージ 2026-07-03 03:23:37 +09:00
4個のファイルの変更30行の追加7行の削除
コミット 881e940e24 の変更だけを表示してゐます - すべてのコミットを表示
+16
ファイルの表示
@@ -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)
+2
ファイルの表示
@@ -70,6 +70,7 @@ describe ('posts API functions', () => {
id: 5,
title: 'new title',
tags: 'tag',
duration: null,
parentPostIds: '1 2',
originalCreatedFrom: null,
originalCreatedBefore: '2026-01-02T00:00:00Z',
@@ -82,6 +83,7 @@ describe ('posts API functions', () => {
{
title: 'new title',
tags: 'tag',
duration: null,
parent_post_ids: '1 2',
original_created_from: null,
original_created_before: '2026-01-02T00:00:00Z',
+8 -4
ファイルの表示
@@ -88,6 +88,10 @@ const weights = buildTheatrePostSelectionWeights ({
tags: [],
}],
})
const watchingUsers = [
{ id: 1, name: 'tester' },
{ id: 2, name: 'another' },
]
const renderPage = (user = buildUser ({ id: 1, role: 'member' })) =>
renderWithProviders (
@@ -136,11 +140,11 @@ const mockDefaultApi = () => {
postId: currentPost.id,
postStartedAt: '2026-01-02T03:04:05.000Z',
postElapsedMs: 1_000,
watchingUsers: [{ id: 1, name: 'tester' }],
watchingUsers,
skipVote: {
votesCount: 0,
requiredCount: 2,
watchingUsersCount: 1,
watchingUsersCount: watchingUsers.length,
voted: false,
},
}))
@@ -150,11 +154,11 @@ const mockDefaultApi = () => {
postId: currentPost.id,
postStartedAt: '2026-01-02T03:04:05.000Z',
postElapsedMs: 2_000,
watchingUsers: [{ id: 1, name: 'tester' }],
watchingUsers,
skipVote: {
votesCount: 1,
requiredCount: 2,
watchingUsersCount: 1,
watchingUsersCount: watchingUsers.length,
voted: true,
},
}))
+4 -3
ファイルの表示
@@ -356,6 +356,7 @@ export type Tag = {
hasWiki: boolean
materialId: number | null
hasDeerjikists: boolean
children?: Tag[]
matchedAlias?: string | null }
export type TagVersion = {
@@ -370,9 +371,9 @@ export type TagVersion = {
createdAt: string
createdByUser: { id: number; name: string | null } | null }
export type TagWithSections = Tag & { sections: { beginMs: number
endMs: number | null }[]
children: TagWithSections[] }
export type TagWithSections = Omit<Tag, 'children'> & { sections: { beginMs: number
endMs: number | null }[]
children: TagWithSections[] }
export type Theatre = {
id: number