base_scope_spec.rb 702 B

12345678910111213141516171819202122232425
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. require 'rails_helper'
  3. RSpec.describe TicketPolicy::BaseScope do
  4. subject(:scope) { described_class.new(user) }
  5. describe '#resolve' do
  6. context 'when querying for agent user' do
  7. let(:user) { create(:agent) }
  8. it 'raises NoMethodError (undefined on abstract base class)' do
  9. expect { scope.resolve }.to raise_error(NoMethodError)
  10. end
  11. end
  12. context 'when querying for customer user' do
  13. let(:user) { create(:customer) }
  14. it 'raises NoMethodError (undefined on abstract base class)' do
  15. expect { scope.resolve }.to raise_error(NoMethodError)
  16. end
  17. end
  18. end
  19. end