Skip to content

Commit a5392c1

Browse files
committed
Test for auther visibility outside of show context
1 parent d0b039a commit a5392c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spec/policies/request_for_comment_policy_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,15 @@
5757
context 'when report emails are configured' do
5858
let(:reports_enabled) { true }
5959

60-
it 'allows anyone to report RfCs' do
60+
it 'allows anyone to report RfCs expect the author' do
6161
%i[admin external_user teacher].each do |factory_name|
62-
expect(policy).to permit(create(factory_name), create(:rfc))
62+
expect(policy).to permit(create(factory_name), rfc)
6363
end
6464
end
65+
66+
it 'blocks authors from reporting their content' do
67+
expect(policy).not_to permit(rfc.author, rfc)
68+
end
6569
end
6670

6771
context 'when no report email is configured' do

0 commit comments

Comments
 (0)