Unify paginated comments specs

This commit is contained in:
taitus
2023-12-18 22:25:40 +01:00
parent 7006564c31
commit d24c2859c4
8 changed files with 22 additions and 148 deletions

View File

@@ -6,24 +6,6 @@ describe "Commenting proposals" do
it_behaves_like "flaggable", :proposal_comment
scenario "Paginated comments" do
per_page = 10
(per_page + 2).times { create(:comment, commentable: proposal) }
visit proposal_path(proposal)
expect(page).to have_css(".comment", count: per_page)
within("ul.pagination") do
expect(page).to have_content("1")
expect(page).to have_content("2")
expect(page).not_to have_content("3")
click_link "Next", exact: false
end
expect(page).to have_css(".comment", count: 2)
expect(page).to have_current_path(/#comments/, url: true)
end
scenario "Create" do
login_as(user)
visit proposal_path(proposal)