Wiki 依存の排除 (#431) (#432)

Reviewed-on: #432
Co-authored-by: miteruzo <miteruzo@naver.com>
このコミットはプルリクエスト #432 でマージされました。
このコミットが含まれているのは:
2026-10-16 00:26:53 +09:00
committed by みてるぞ
コミット 75d7dac999
75個のファイルの変更、1474行の追加、3000行の削除
+22
ファイルの表示
@@ -0,0 +1,22 @@
RSpec.shared_context 'Ainu locale contract' do
let(:ainu_locale) { instance_double(Locale, language_code: 'ain', script_code: 'Jpan') }
before do
# Only the foreign-key reference is seeded; no Locale or enum is enabled.
Language.connection.execute(<<~SQL)
INSERT IGNORE INTO languages (code, name, created_at)
VALUES ('ain', 'Ainu', CURRENT_TIMESTAMP)
SQL
allow(Locale).to receive(:find_by).and_call_original
allow(Locale).to receive(:find_by).with(code: 'ain').and_return(ainu_locale)
end
def add_ainu_name tag, name
TagName.insert_all!([{
tag_id: tag.id, language_code: 'ain', script_code: 'Jpan', name:,
primary_flg: true, auto_generated: false,
created_at: Time.current, updated_at: Time.current }])
tag.tag_names.reset
TagName.find_by!(tag_id: tag.id, language_code: 'ain', name:)
end
end