Loading app/assets/javascripts/app/views/comment_stream_view.js +3 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ app.views.CommentStream = app.views.Base.extend({ // on post ownership in the Comment view. comment.set({parent : this.model.toJSON()}); var commentHtml = new this.CommentView({model: comment}).render().el; var commentView = new this.CommentView({model: comment}); var commentHtml = commentView.render().el; var commentBlocks = this.$(".comments div.comment.media"); this._moveInsertPoint(comment.get("created_at"), commentBlocks); if (this._insertPoint >= commentBlocks.length) { Loading @@ -128,6 +129,7 @@ app.views.CommentStream = app.views.Base.extend({ } else { commentBlocks.eq(this._insertPoint).before(commentHtml); } commentView.renderPluginWidgets(); }, removeComment: function(comment) { Loading app/assets/javascripts/app/views/comment_view.js +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ app.views.Comment = app.views.Content.extend({ templateName: "comment", className : "comment media", tooltipSelector: "time", events : function() { return _.extend({}, app.views.Content.prototype.events, { Loading features/step_definitions/custom_web_steps.rb +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ When /^I click to delete the first post$/ do accept_alert do step "I prepare the deletion of the first post" end expect(find(".stream")).to have_no_css(".stream-element.loaded.deleting") end When /^I click to hide the first post$/ do Loading spec/javascripts/app/views/comment_stream_view_spec.js +8 −0 Original line number Diff line number Diff line Loading @@ -267,6 +267,14 @@ describe("app.views.CommentStream", function(){ expect(this.view.$(".comments div.comment.media").length).toEqual(6); expect(this.view.$(".comments div.comment.media div.comment-content p").text()).toEqual("123456"); }); it("calls renderPluginWidgets", function() { var comment = factory.comment(); this.view.CommentView = app.views.Comment; spyOn(app.views.Comment.prototype, "renderPluginWidgets"); this.view.appendComment(comment); expect(app.views.Comment.prototype.renderPluginWidgets).toHaveBeenCalled(); }); }); describe("removeComment", function() { Loading Loading
app/assets/javascripts/app/views/comment_stream_view.js +3 −1 Original line number Diff line number Diff line Loading @@ -118,7 +118,8 @@ app.views.CommentStream = app.views.Base.extend({ // on post ownership in the Comment view. comment.set({parent : this.model.toJSON()}); var commentHtml = new this.CommentView({model: comment}).render().el; var commentView = new this.CommentView({model: comment}); var commentHtml = commentView.render().el; var commentBlocks = this.$(".comments div.comment.media"); this._moveInsertPoint(comment.get("created_at"), commentBlocks); if (this._insertPoint >= commentBlocks.length) { Loading @@ -128,6 +129,7 @@ app.views.CommentStream = app.views.Base.extend({ } else { commentBlocks.eq(this._insertPoint).before(commentHtml); } commentView.renderPluginWidgets(); }, removeComment: function(comment) { Loading
app/assets/javascripts/app/views/comment_view.js +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ app.views.Comment = app.views.Content.extend({ templateName: "comment", className : "comment media", tooltipSelector: "time", events : function() { return _.extend({}, app.views.Content.prototype.events, { Loading
features/step_definitions/custom_web_steps.rb +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ When /^I click to delete the first post$/ do accept_alert do step "I prepare the deletion of the first post" end expect(find(".stream")).to have_no_css(".stream-element.loaded.deleting") end When /^I click to hide the first post$/ do Loading
spec/javascripts/app/views/comment_stream_view_spec.js +8 −0 Original line number Diff line number Diff line Loading @@ -267,6 +267,14 @@ describe("app.views.CommentStream", function(){ expect(this.view.$(".comments div.comment.media").length).toEqual(6); expect(this.view.$(".comments div.comment.media div.comment-content p").text()).toEqual("123456"); }); it("calls renderPluginWidgets", function() { var comment = factory.comment(); this.view.CommentView = app.views.Comment; spyOn(app.views.Comment.prototype, "renderPluginWidgets"); this.view.appendComment(comment); expect(app.views.Comment.prototype.renderPluginWidgets).toHaveBeenCalled(); }); }); describe("removeComment", function() { Loading