Add show and collapse text on comments tree
This commit is contained in:
@@ -63,20 +63,25 @@ describe "Commenting polls" do
|
||||
visit poll_path(poll)
|
||||
|
||||
expect(page).to have_css(".comment", count: 3)
|
||||
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||
|
||||
find("#comment_#{child_comment.id}_children_arrow").click
|
||||
|
||||
expect(page).to have_css(".comment", count: 2)
|
||||
expect(page).to have_content("1 response (collapse)")
|
||||
expect(page).to have_content("1 response (show)")
|
||||
expect(page).not_to have_content grandchild_comment.body
|
||||
|
||||
find("#comment_#{child_comment.id}_children_arrow").click
|
||||
|
||||
expect(page).to have_css(".comment", count: 3)
|
||||
expect(page).to have_content("1 response (collapse)", count: 2)
|
||||
expect(page).to have_content grandchild_comment.body
|
||||
|
||||
find("#comment_#{parent_comment.id}_children_arrow").click
|
||||
|
||||
expect(page).to have_css(".comment", count: 1)
|
||||
expect(page).to have_content("1 response (show)")
|
||||
expect(page).not_to have_content child_comment.body
|
||||
expect(page).not_to have_content grandchild_comment.body
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user