locale.rb 417 B

1234567891011121314
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. FactoryBot.define do
  3. factory 'knowledge_base/locale', aliases: %i[knowledge_base_locale] do
  4. knowledge_base { nil }
  5. system_locale { Locale.first || create(:locale) }
  6. before :create do |kb_locale|
  7. if kb_locale.knowledge_base.blank?
  8. create(:knowledge_base, given_kb_locale: kb_locale)
  9. end
  10. end
  11. end
  12. end