Enhance comment section: update comment button to link to form and ensure form is displayed on the page

This commit is contained in:
Brenda Wallace committed 2026-10-16 22:21:26 +13:00
1 parent 6b4b407e1f
commit 0ff036dbff
1 file changed
+6 -2
+6 -2
View File
@@ -120,8 +120,12 @@ describe "posts/show" do
render
end
it 'shows a comment button' do
expect(subject).to have_link "Comment", href: new_comment_path(comment: { commentable_type: "Post", commentable_id: post.id })
it 'shows a comment button that jumps to the comment form' do
expect(subject).to have_link "Comment", href: '#new-comment'
end
it 'shows the comment form on the page' do
expect(subject).to have_css "#new-comment form[action='#{comments_path}']"
end
end
end