Skip to content

Commit 61ab246

Browse files
committed
Add a test when the report button is not rendered.
1 parent 83344fd commit 61ab246

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

spec/system/request_for_comments_filter_system_spec.rb

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,27 @@
4545
expect(page).to have_css('ul.pagination')
4646
end
4747

48-
context 'when reporting is enabled' do
49-
let(:report_emails) { ['[email protected]'] }
48+
describe 'reporting of user content' do
49+
before do
50+
visit(request_for_comment_path(create(:rfc)))
51+
end
52+
53+
context 'when reporting is enabled' do
54+
let(:report_emails) { ['[email protected]'] }
5055

51-
it 'allows reporting of RfCs', :js do
52-
request_for_comment = create(:rfc)
53-
visit(request_for_comment_path(request_for_comment))
56+
it 'allows reporting of RfCs', :js do
57+
accept_confirm do
58+
click_on I18n.t('request_for_comments.report.report')
59+
end
5460

55-
accept_confirm do
56-
click_on I18n.t('request_for_comments.report.report')
61+
expect(page).to have_text(I18n.t('request_for_comments.report.reported'))
5762
end
63+
end
5864

59-
expect(page).to have_text(I18n.t('request_for_comments.report.reported'))
65+
context 'when reporting is disabled' do
66+
it 'dose not display the report button' do
67+
expect(page).to have_no_button(I18n.t('request_for_comments.report.report'))
68+
end
6069
end
6170
end
6271
end

0 commit comments

Comments
 (0)