From e3ce8a85fa071dd0aef512b7dd5d012248e80835 Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 20 Dec 2023 00:37:48 +0100 Subject: [PATCH] Unify show comments specs --- spec/system/comments/debates_spec.rb | 10 ---------- spec/system/comments_spec.rb | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/system/comments/debates_spec.rb b/spec/system/comments/debates_spec.rb index 8e47ee29b..518465115 100644 --- a/spec/system/comments/debates_spec.rb +++ b/spec/system/comments/debates_spec.rb @@ -6,16 +6,6 @@ describe "Commenting debates" do it_behaves_like "flaggable", :debate_comment - scenario "Show comment when the author is hidden" do - create(:comment, body: "This is pointless", commentable: debate, author: create(:user, :hidden)) - - visit debate_path(debate) - - within ".comment", text: "This is pointless" do - expect(page).to have_content "User deleted" - end - end - scenario "Submit button is disabled after clicking" do debate = create(:debate) login_as(user) diff --git a/spec/system/comments_spec.rb b/spec/system/comments_spec.rb index 6af0782a1..6fa1c9cbf 100644 --- a/spec/system/comments_spec.rb +++ b/spec/system/comments_spec.rb @@ -497,6 +497,16 @@ describe "Comments" do end end + scenario "Show comment when the author is hidden" do + create(:comment, body: "This is pointless", commentable: resource, author: create(:user, :hidden)) + + visit polymorphic_path(resource) + + within ".comment", text: "This is pointless" do + expect(page).to have_content "User deleted" + end + end + describe "Moderators" do let(:moderator) { create(:moderator) } before { login_as(moderator.user) }