translation_spec.rb 555 B

12345678910111213141516
  1. # Copyright (C) 2012-2022 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. require 'models/contexts/factory_context'
  4. RSpec.describe KnowledgeBase::Translation, type: :model do
  5. subject { create(:knowledge_base).translations.first }
  6. include_context 'factory'
  7. it { is_expected.to validate_presence_of(:title) }
  8. it { is_expected.to validate_uniqueness_of(:kb_locale_id).scoped_to(:knowledge_base_id).with_message(%r{}) }
  9. it { is_expected.to belong_to(:knowledge_base) }
  10. it { is_expected.to belong_to(:kb_locale) }
  11. end