このコミットが含まれているのは:
2026-09-27 15:07:24 +09:00
コミット c912bebbee
40個のファイルの変更、473行の追加、377行の削除
+14 -5
ファイルの表示
@@ -64,7 +64,8 @@ RSpec.describe 'nico:sync' do
run_rake_task('nico:sync')
post.reload
active_tag_names = post.tags.joins(:tag_name).pluck('tag_names.name')
active_tag_names = TagName.where(tag_id: post.tags.select(:id),
language_code: 'ja', primary_flg: true).pluck(:name)
expect(active_tag_names).to include('spec_kept')
expect(post.external_tags).to contain_exactly(nico)
@@ -434,7 +435,9 @@ RSpec.describe 'nico:sync' do
external = post.external_tags.sole
expect(external.name).to eq('raw tag[]')
expect(post.tags.map(&:name)).not_to include('bot操作')
expect(TagName.where(tag_id: post.tags.select(:id),
language_code: 'ja', primary_flg: true).pluck(:name))
.not_to include('bot操作')
expect(post.post_versions.order(:version_no).last.tags_json)
.to include('external_tag_id' => external.id)
@@ -446,7 +449,9 @@ RSpec.describe 'nico:sync' do
run_nico_sync_with_tags!([])
}.to change(PostVersion, :count).by(1)
expect(post.reload.external_tags).to be_empty
expect(post.tags.map(&:name)).not_to include('bot操作')
expect(TagName.where(tag_id: post.tags.select(:id),
language_code: 'ja', primary_flg: true).pluck(:name))
.not_to include('bot操作')
end
it 'サニタイズ後の既存外部タグを再利用し、その連携タグを記載する' do
@@ -563,7 +568,9 @@ RSpec.describe 'nico:sync' do
name: 'AAA')
expect(ExternalTag.exists?(platform: :nico, name: 'AAA?')).to be(false)
expect(post.tags.map(&:name)).not_to include('bot操作')
expect(TagName.where(tag_id: post.tags.select(:id),
language_code: 'ja', primary_flg: true).pluck(:name))
.not_to include('bot操作')
expect(post.post_versions.order(:version_no).last.tags_json)
.to include('external_tag_id' => external.id)
@@ -577,7 +584,9 @@ RSpec.describe 'nico:sync' do
}.to change(PostVersion, :count).by(1)
expect(post.reload.external_tags).to be_empty
expect(post.tags.map(&:name)).not_to include('bot操作')
expect(TagName.where(tag_id: post.tags.select(:id),
language_code: 'ja', primary_flg: true).pluck(:name))
.not_to include('bot操作')
end
it 'nico: prefix を含む従来の規則で外部タグ名をサニタイズする' do