File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change 55RSpec . describe 'POST /request_for_comments/:rfc_id/report' , type : :request do
66 let ( :user ) { create ( :learner ) }
77 let ( :rfc ) { create ( :rfc ) }
8-
98
109 before do
1110 stub_const ( 'RequestForCommentPolicy::REPORT_RECEIVER_CONFIGURED' , true )
Original file line number Diff line number Diff line change 44
55RSpec . describe 'Request_for_Comments' do
66 let ( :user ) { create ( :teacher ) }
7- let ( :report_emails ) { [ ] }
7+ let ( :reports_enabled ) { false }
88
99 before do
10- codeocean_config = instance_double ( CodeOcean ::Config )
11- allow ( CodeOcean ::Config ) . to receive ( :new ) . with ( :code_ocean ) . and_return ( codeocean_config )
12- allow ( codeocean_config ) . to receive ( :read ) . and_return ( {
13- content_moderation : { report_emails :} ,
14- } )
15-
10+ stub_const ( 'RequestForCommentPolicy::REPORT_RECEIVER_CONFIGURED' , reports_enabled )
1611 visit ( sign_in_path )
1712 fill_in ( 'email' , with : user . email )
1813 fill_in ( 'password' , with : attributes_for ( :teacher ) [ :password ] )
4742
4843 describe 'reporting of user content' do
4944 before do
50- stub_const ( 'RequestForCommentPolicy::REPORT_RECEIVER_CONFIGURED' , reports_enabled )
5145 visit ( request_for_comment_path ( create ( :rfc ) ) )
5246 end
5347
6458 end
6559
6660 context 'when reporting is disabled' do
67- let ( :reports_enabled ) { false }
68-
6961 it 'does not display the report button' do
7062 expect ( page ) . to have_no_button ( I18n . t ( 'request_for_comments.report.report' ) )
7163 end
You can’t perform that action at this time.
0 commit comments