knowledge_base_policy_spec.rb 587 B

12345678910111213141516171819
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. require 'policies/knowledge_base_policy_examples'
  4. describe KnowledgeBasePolicy do
  5. subject(:policy) { described_class.new(user, record) }
  6. let(:record) { create(:knowledge_base) }
  7. let(:user) { create(:user) }
  8. describe '#show?' do
  9. include_examples 'with KB policy check', editor: true, reader: true, none: false, method: :show?
  10. end
  11. describe 'update?' do
  12. include_examples 'with KB policy check', editor: true, reader: false, none: false, method: :update?
  13. end
  14. end