knowledge_base_contexts.rb 880 B

123456789101112131415161718192021222324252627282930313233
  1. RSpec.shared_context 'basic Knowledge Base', current_user_id: 1 do
  2. let :knowledge_base do
  3. create(:knowledge_base)
  4. end
  5. let :primary_locale do
  6. knowledge_base.translation_primary.kb_locale
  7. end
  8. let :alternative_locale do
  9. create(:knowledge_base_locale, knowledge_base: knowledge_base, system_locale: Locale.find_by(locale: 'lt'))
  10. end
  11. let :category do
  12. create(:knowledge_base_category, knowledge_base: knowledge_base)
  13. end
  14. let :draft_answer do
  15. create(:knowledge_base_answer, category: category)
  16. end
  17. let :published_answer do
  18. create(:knowledge_base_answer, category: category, published_at: 1.week.ago)
  19. end
  20. let :internal_answer do
  21. create(:knowledge_base_answer, category: category, internal_at: 1.week.ago)
  22. end
  23. let :archived_answer do
  24. create(:knowledge_base_answer, category: category, archived_at: 1.week.ago)
  25. end
  26. end