Skip to content

Commit 90cbba0

Browse files
committed
Fix test with stub
1 parent 0a3f75f commit 90cbba0

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

spec/request/request_for_comments_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
RSpec.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)

spec/system/request_for_comments_filter_system_spec.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@
44

55
RSpec.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])
@@ -47,7 +42,6 @@
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

@@ -64,8 +58,6 @@
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

0 commit comments

Comments
 (0)