translation_spec.rb 476 B

1234567891011121314
  1. require 'rails_helper'
  2. require 'models/contexts/factory_context'
  3. RSpec.describe KnowledgeBase::Translation, type: :model do
  4. subject { create(:knowledge_base).translations.first }
  5. include_context 'factory'
  6. it { is_expected.to validate_presence_of(:title) }
  7. it { is_expected.to validate_uniqueness_of(:kb_locale_id).scoped_to(:knowledge_base_id).with_message(//) }
  8. it { is_expected.to belong_to(:knowledge_base) }
  9. it { is_expected.to belong_to(:kb_locale) }
  10. end