From deee26e0e3830135111f3064b836f587c4588c0c Mon Sep 17 00:00:00 2001 From: Daniela Soares Feitosa Date: Mon, 29 Jul 2013 03:56:57 +0000 Subject: [PATCH] Fix: "Post a comment" button was disappearing --- features/comment.feature | 6 ++++++ public/javascripts/comment_form.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/features/comment.feature b/features/comment.feature index 10f0724..059ea96 100644 --- a/features/comment.feature +++ b/features/comment.feature @@ -91,3 +91,9 @@ Feature: comment And I follow "Post a comment" When I press "Post comment" And I should see "2 comments" + + @selenium + Scenario: hide post a comment button when clicked + Given I am on /booking/article-to-comment + And I follow "Post a comment" + Then "Post a comment" should not be visible within "#article" diff --git a/public/javascripts/comment_form.js b/public/javascripts/comment_form.js index 852dcce..10466ab 100644 --- a/public/javascripts/comment_form.js +++ b/public/javascripts/comment_form.js @@ -2,7 +2,7 @@ jQuery('.display-comment-form').unbind(); jQuery('.display-comment-form').click(function(){ var $button = jQuery(this); toggleBox($button.parents('.post_comment_box')); - jQuery('.display-comment-form').hide(); + jQuery($button).hide(); $button.closest('.page-comment-form').find('input').first().focus(); return false; }); -- libgit2 0.21.2