data_privacy_task_policy_spec.rb 482 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. describe DataPrivacyTaskPolicy do
  4. subject { described_class.new(user, record) }
  5. let(:record) { create(:data_privacy_task) }
  6. context 'when user is admin' do
  7. let(:user) { create(:admin) }
  8. it { is_expected.to permit_actions(:show) }
  9. end
  10. context 'when user is agent' do
  11. let(:user) { create(:agent) }
  12. it { is_expected.to forbid_actions(:show) }
  13. end
  14. end