From 0ff036dbff957dfafe6367170bdcf28346ace6ab Mon Sep 17 00:00:00 2001 From: Brenda Wallace Date: Fri, 16 Oct 2026 22:12:38 +1300 Subject: [PATCH] Enhance comment section: update comment button to link to form and ensure form is displayed on the page --- spec/views/posts/show.html.haml_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/views/posts/show.html.haml_spec.rb b/spec/views/posts/show.html.haml_spec.rb index aede4c9d8..21960ee3a 100644 --- a/spec/views/posts/show.html.haml_spec.rb +++ b/spec/views/posts/show.html.haml_spec.rb @@ -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