Unify reply to reply comments specs

This commit is contained in:
taitus
2023-12-20 00:32:14 +01:00
parent 8da4c60c2a
commit 886aee72fc
2 changed files with 25 additions and 25 deletions

View File

@@ -6,31 +6,6 @@ describe "Commenting debates" do
it_behaves_like "flaggable", :debate_comment
scenario "Reply to reply" do
create(:comment, commentable: debate, body: "Any estimates?")
login_as(create(:user))
visit debate_path(debate)
within ".comment", text: "Any estimates?" do
click_link "Reply"
fill_in "Leave your comment", with: "It will be done next week."
click_button "Publish reply"
end
within ".comment .comment", text: "It will be done next week" do
click_link "Reply"
fill_in "Leave your comment", with: "Probably if government approves."
click_button "Publish reply"
expect(page).not_to have_css ".comment-form"
within ".comment" do
expect(page).to have_content "Probably if government approves."
end
end
end
scenario "Show comment when the author is hidden" do
create(:comment, body: "This is pointless", commentable: debate, author: create(:user, :hidden))

View File

@@ -400,6 +400,31 @@ describe "Comments" do
expect(page).not_to have_css "#js-comment-form-comment_#{comment.id}"
end
scenario "Reply to reply" do
create(:comment, commentable: resource, body: "Any estimates?")
login_as(user)
visit polymorphic_path(resource)
within ".comment", text: "Any estimates?" do
click_link "Reply"
fill_in fill_text, with: "It will be done next week."
click_button "Publish reply"
end
within ".comment .comment", text: "It will be done next week" do
click_link "Reply"
fill_in fill_text, with: "Probably if government approves."
click_button "Publish reply"
expect(page).not_to have_css ".comment-form"
within ".comment" do
expect(page).to have_content "Probably if government approves."
end
end
end
scenario "Reply update parent comment responses count" do
comment = create(:comment, commentable: resource)