17 lines
511 B
Ruby
17 lines
511 B
Ruby
|
require 'rails_helper'
|
||
|
require 'models/contexts/factory_context'
|
||
|
|
||
|
RSpec.describe KnowledgeBase::Answer::Translation, type: :model do
|
||
|
subject { create(:knowledge_base_answer_translation) }
|
||
|
|
||
|
before { UserInfo.current_user_id = 1 }
|
||
|
|
||
|
include_context 'factory'
|
||
|
|
||
|
it { is_expected.to validate_presence_of(:title) }
|
||
|
it { is_expected.to validate_uniqueness_of(:kb_locale_id).scoped_to(:answer_id).with_message(//) }
|
||
|
|
||
|
it { is_expected.to belong_to(:answer) }
|
||
|
it { is_expected.to belong_to(:kb_locale) }
|
||
|
end
|