このコミットが含まれているのは:
@@ -6,6 +6,25 @@ RSpec.describe Post, type: :model do
|
||||
PostUrlSanitisationRule.unscoped.delete_all
|
||||
end
|
||||
|
||||
describe '#snapshot_tags_json' do
|
||||
it 'keeps internal snapshots and external identifiers distinct, even with the same id' do
|
||||
post = create(:post)
|
||||
tag = create(:tag)
|
||||
external = create(:external_tag, id: tag.id)
|
||||
create(:post_tag, post:, tag:)
|
||||
create(:post_tag_section, post:, tag:, begin_ms: 2000, end_ms: nil)
|
||||
PostExternalTag.create!(post:, external_tag: external)
|
||||
|
||||
expect(post.snapshot_tags_json).to eq([
|
||||
{ 'tag_id' => tag.id,
|
||||
'version_no' => tag.version_no,
|
||||
'name' => tag.name,
|
||||
'category' => tag.category,
|
||||
'sections' => [{ 'begin_ms' => 2000, 'end_ms' => nil }] },
|
||||
{ 'external_tag_id' => external.id }])
|
||||
end
|
||||
end
|
||||
|
||||
describe 'URL normalisation' do
|
||||
it 'normalises the HTTP URL before applying sanitisation rules' do
|
||||
PostUrlSanitisationRule.create!(
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする