Unify show comments specs

This commit is contained in:
taitus
2023-12-20 00:37:48 +01:00
parent 886aee72fc
commit e3ce8a85fa
2 changed files with 10 additions and 10 deletions

View File

@@ -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)

View File

@@ -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) }