1
0

dashboard_policy_spec.rb 460 B

1234567891011121314151617181920
  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe DashboardPolicy do
  4. subject { described_class }
  5. let(:admin) { Fabricate(:user, role: UserRole.find_by(name: 'Admin')).account }
  6. let(:account) { Fabricate(:account) }
  7. permissions :index? do
  8. context 'with an admin' do
  9. it { is_expected.to permit(admin, nil) }
  10. end
  11. context 'with a non-admin' do
  12. it { is_expected.to_not permit(account, nil) }
  13. end
  14. end
  15. end