このコミットが含まれているのは:
@@ -1,19 +1,22 @@
|
||||
RSpec.shared_context 'Ainu locale contract' do
|
||||
let(:ainu_locale) { instance_double(Locale, language_code: 'ain', script_code: 'Jpan') }
|
||||
let(:ainu_locale) do
|
||||
instance_double(Locale, language_code: 'ain', script_code: 'Kana', deprecated_at: nil)
|
||||
end
|
||||
|
||||
before do
|
||||
# Only the foreign-key reference is seeded; no Locale or enum is enabled.
|
||||
# Keep description contracts independent of locale activation and backfill.
|
||||
Language.connection.execute(<<~SQL)
|
||||
INSERT IGNORE INTO languages (code, name, created_at)
|
||||
VALUES ('ain', 'Ainu', CURRENT_TIMESTAMP)
|
||||
SQL
|
||||
Script.find_or_create_by!(code: 'Kana') { _1.name = 'Kana' }
|
||||
allow(Locale).to receive(:find_by).and_call_original
|
||||
allow(Locale).to receive(:find_by).with(code: 'ain').and_return(ainu_locale)
|
||||
allow(Locale).to receive(:find_by).with(code: 'ain-Kana').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:,
|
||||
tag_id: tag.id, language_code: 'ain', script_code: 'Kana', name:,
|
||||
primary_flg: true, auto_generated: false,
|
||||
created_at: Time.current, updated_at: Time.current }])
|
||||
tag.tag_names.reset
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする