Skip to content

Commit

Permalink
Add minimal spec for the comment history? pundit policy
Browse files Browse the repository at this point in the history
  • Loading branch information
krauselukas committed Mar 1, 2024
1 parent 5ee29cf commit cddd60e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/api/spec/policies/comment_policy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,20 @@
end
end
end

permissions :history? do
before do
Flipper.enable(:content_moderation)
end

let(:staff_user) { create(:staff_user) }
let(:moderator) { create(:moderator) }

it { is_expected.not_to permit(other_user, comment) }
it { is_expected.not_to permit(comment_author, comment) }
it { is_expected.to permit(moderator, comment) }
it { is_expected.to permit(admin_user, comment) }
it { is_expected.to permit(staff_user, comment) }
it { is_expected.not_to permit(moderator, comment_deleted) }
end
end

0 comments on commit cddd60e

Please sign in to comment.