このコミットが含まれているのは:
2026-09-27 03:47:27 +09:00
コミット 701830b643
18個のファイルの変更、260行の追加、187行の削除
+9 -5
ファイルの表示
@@ -202,17 +202,19 @@ RSpec.describe 'Locale propagation on write paths', type: :request do
expect(response).to have_http_status(:ok), response.body
expect(TagName.find_by!(language_code: 'en', name: 'english_alias'))
.to have_attributes(
script_code: 'Latn', canonical_id: english_name.id,
script_code: 'Latn',
tag_id: tag.id, primary_flg: false, language_code: 'en')
expect(tag.reload.tag_name_id).to eq(english_name.id)
primary = TagName.find_by!(tag_id: tag.id, language_code: 'en', primary_flg: true)
expect(primary).to have_attributes(name: 'english_original', script_code: 'Latn')
end
it 'does not take an alias from another language' do
japanese = create(:tag, name: 'japanese_owner')
japanese_alias = create(:tag_name, :alias, name: 'shared_alias',
canonical: japanese.tag_name)
tag: japanese)
expect(japanese_alias.reload).to have_attributes(
canonical_id: japanese.tag_name_id, tag_id: japanese.id,
tag_id: japanese.id,
primary_flg: false, language_code: 'ja')
put "/tags/#{ tag.id }", params: {
@@ -221,12 +223,14 @@ RSpec.describe 'Locale propagation on write paths', type: :request do
expect(response).to have_http_status(:ok), response.body
expect(japanese_alias.reload).to have_attributes(
canonical_id: japanese.tag_name_id, tag_id: japanese.id,
tag_id: japanese.id,
primary_flg: false, language_code: 'ja')
expect(TagName.find_by!(language_code: 'en', name: 'shared_alias'))
.to have_attributes(
canonical_id: english_name.id, tag_id: tag.id,
tag_id: tag.id, script_code: 'Latn',
primary_flg: false, language_code: 'en')
expect(TagName.where(name: 'shared_alias').pluck(:language_code, :tag_id))
.to contain_exactly(['ja', japanese.id], ['en', tag.id])
end
end
end