diff --git a/spec/system/comments/debates_spec.rb b/spec/system/comments/debates_spec.rb index 43dd0d910..8e47ee29b 100644 --- a/spec/system/comments/debates_spec.rb +++ b/spec/system/comments/debates_spec.rb @@ -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)) diff --git a/spec/system/comments_spec.rb b/spec/system/comments_spec.rb index 620a5c867..6af0782a1 100644 --- a/spec/system/comments_spec.rb +++ b/spec/system/comments_spec.rb @@ -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)