diff --git a/spec/system/comments/debates_spec.rb b/spec/system/comments/debates_spec.rb index d560c6f36..c59bc348f 100644 --- a/spec/system/comments/debates_spec.rb +++ b/spec/system/comments/debates_spec.rb @@ -6,25 +6,6 @@ describe "Commenting debates" do it_behaves_like "flaggable", :debate_comment - scenario "can collapse comments after adding a reply" do - create(:comment, body: "Main comment", commentable: debate) - - login_as(user) - visit debate_path(debate) - - within ".comment", text: "Main comment" do - first(:link, "Reply").click - fill_in "Leave your comment", with: "It will be done next week." - click_button "Publish reply" - - expect(page).to have_content("It will be done next week.") - - click_link text: "1 response (collapse)" - - expect(page).not_to have_content("It will be done next week.") - end - end - describe "Hide" do scenario "Without replies" do create(:comment, commentable: debate, user: user, body: "This was a mistake") diff --git a/spec/system/comments_spec.rb b/spec/system/comments_spec.rb index 3814383f3..ebbdbf7cc 100644 --- a/spec/system/comments_spec.rb +++ b/spec/system/comments_spec.rb @@ -163,6 +163,25 @@ describe "Comments" do expect(page).not_to have_content grandchild_comment.body end + scenario "can collapse comments after adding a reply" do + create(:comment, body: "Main comment", commentable: resource) + + login_as(user) + visit polymorphic_path(resource) + + within ".comment", text: "Main comment" do + first(:link, "Reply").click + fill_in fill_text, with: "It will be done next week." + click_button "Publish reply" + + expect(page).to have_content("It will be done next week.") + + click_link text: "1 response (collapse)" + + expect(page).not_to have_content("It will be done next week.") + end + end + describe "Not logged user" do scenario "can not see comments forms" do create(:comment, commentable: resource)