File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ def rfcs_with_my_comments?
4242 end
4343
4444 def report?
45- report_receiver_configured? && !author?
45+ report_receiver_configured? && show? && !author?
4646 end
4747
4848 private
Original file line number Diff line number Diff line change 317317 end
318318 end
319319
320+ it 'dose not allow reports when the RfC is not accessable' do
321+ allow ( policy ) . to receive ( :show? ) . and_return ( false ) # rubocop:disable RSpec/SubjectStub
322+
323+ %i[ admin external_user teacher ] . each do |factory_name |
324+ expect ( policy ) . not_to permit ( create ( factory_name ) , Comment . new )
325+ end
326+ end
327+
320328 it 'dose not allow reports when no report email is configured' do
321329 codeocean_config = instance_double ( CodeOcean ::Config )
322330 allow ( CodeOcean ::Config ) . to receive ( :new ) . with ( :code_ocean ) . and_return ( codeocean_config )
You can’t perform that action at this time.
0 commit comments