0
0
Fork 0

Improve app/policies coverage (#32426)

This commit is contained in:
Matt Jankowski 2024-10-15 10:24:12 -04:00 committed by GitHub
parent 28131b4b00
commit 9e8f099d38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 264 additions and 55 deletions

View file

@ -1,7 +1,6 @@
# frozen_string_literal: true
require 'rails_helper'
require 'pundit/rspec'
RSpec.describe AccountModerationNotePolicy do
subject { described_class }
@ -12,13 +11,13 @@ RSpec.describe AccountModerationNotePolicy do
permissions :create? do
context 'when staff' do
it 'grants to create' do
expect(subject).to permit(admin, described_class)
expect(subject).to permit(admin, AccountModerationNote)
end
end
context 'when not staff' do
it 'denies to create' do
expect(subject).to_not permit(john, described_class)
expect(subject).to_not permit(john, AccountModerationNote)
end
end
end