Unverified Commit 3016280e authored by ivan sebastian's avatar ivan sebastian Committed by Steffen van Bergerem
Browse files

add jquery are you sure to comment form

closes #7530
parent 7e0cbff4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
## Bug fixes

## Features
* Ask for confirmation when leaving a submittable comment field [#7530](https://github.com/diaspora/diaspora/pull/7530)

# 0.7.0.0

+2 −0
Original line number Diff line number Diff line
@@ -37,6 +37,8 @@ app.views.CommentStream = app.views.Base.extend({
      }.bind(this),
      onFocus: this.openForm.bind(this)
    });

    this.$("form").areYouSure();
  },

  presenter: function(){
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ Feature: commenting
    When I focus the comment field
    And I fill in the following:
        | text            | is that a poodle?    |
    And I reject the alert after I follow "My activity"
    And I press "Comment"
    Then I should see "is that a poodle?" within ".comment"
    And I should see "less than a minute ago" within ".comment time"
+6 −0
Original line number Diff line number Diff line
@@ -92,6 +92,12 @@ describe("app.views.CommentStream", function(){
      expect(renderedPreview).toBe("<div class='preview-content'>" + renderedText + "</div>");
      expect(renderedPreview).toContain("Alice Awesome");
    });

    it("calls jQuery.AreYouSure()", function() {
      spyOn($.fn, "areYouSure");
      this.view.postRenderTemplate();
      expect($.fn.areYouSure).toHaveBeenCalled();
    });
  });

  describe("createComment", function() {