diff --git a/public/javascripts/app/views/post_view.js b/public/javascripts/app/views/post_view.js index 42b9379f5..35eb63d5c 100644 --- a/public/javascripts/app/views/post_view.js +++ b/public/javascripts/app/views/post_view.js @@ -22,22 +22,14 @@ app.views.Post = app.views.StreamObject.extend({ tooltipSelector : ".delete, .block_user, .post_scope", initialize : function() { - // set the guid $(this.el).attr("id", this.model.get("guid")); - // remove post this.model.bind('remove', this.remove, this); - // commentStream view + //subviews this.commentStreamView = new app.views.CommentStream({ model : this.model}); this.likesInfoView = new app.views.LikesInfo({ model : this.model}); - - // feedback view - if(window.app.user().current_user) { - this.feedbackView = new app.views.Feedback({model : this.model}); - } else { - this.feedbackView = null; - } + this.feedbackView = window.app.user().current_user && new app.views.Feedback({model : this.model}); return this; }, diff --git a/spec/javascripts/app/views/post_view_spec.js b/spec/javascripts/app/views/post_view_spec.js index 0f7a14678..3ddeb5ede 100644 --- a/spec/javascripts/app/views/post_view_spec.js +++ b/spec/javascripts/app/views/post_view_spec.js @@ -164,7 +164,7 @@ describe("app.views.Post", function(){ window.current_user = app.user(null); var view = new app.views.Post({model : this.statusMessage}).render(); - expect(view.feedbackView).toBeNull(); + expect(view.feedbackView).toBeFalsy(); }) })