translation_policy_spec.rb 554 B

123456789101112131415161718
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. describe KnowledgeBase::Answer::TranslationPolicy do
  4. subject(:policy) { described_class.new(user, record) }
  5. let(:record) { create(:knowledge_base_answer_translation) }
  6. let(:user) { create(:user) }
  7. describe '#show?' do
  8. it 'relays to KnowledgeBase::Answer policy' do
  9. allow_any_instance_of(KnowledgeBase::AnswerPolicy).to receive(:show?).and_return(:expected_value)
  10. expect(policy.show?).to eq :expected_value
  11. end
  12. end
  13. end