Unify index comments specs

This commit is contained in:
taitus
2023-12-14 10:28:25 +01:00
parent a5e4fb13b4
commit ab79d1e30e
8 changed files with 47 additions and 127 deletions

View File

@@ -6,21 +6,6 @@ describe "Commenting proposals" do
it_behaves_like "flaggable", :proposal_comment
scenario "Index" do
3.times { create(:comment, commentable: proposal) }
comment = Comment.includes(:user).last
visit proposal_path(proposal)
expect(page).to have_css(".comment", count: 3)
within first(".comment") do
expect(page).to have_content comment.user.name
expect(page).to have_content I18n.l(comment.created_at, format: :datetime)
expect(page).to have_content comment.body
end
end
scenario "Show" do
parent_comment = create(:comment, commentable: proposal, body: "Parent")
create(:comment, commentable: proposal, parent: parent_comment, body: "First subcomment")