email_address_policy_spec.rb 605 B

123456789101112131415161718192021222324252627
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. describe EmailAddressPolicy do
  4. subject { described_class.new(user, record) }
  5. let(:record) { create(:email_address) }
  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 permit_actions(:show) }
  13. end
  14. context 'when user is customer' do
  15. let(:user) { create(:customer) }
  16. it { is_expected.to forbid_actions(:show) }
  17. end
  18. end