Commit 7b1d7b8a authored by Dennis Collinson's avatar Dennis Collinson

small refactor

parent ee6fc187
......@@ -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;
},
......
......@@ -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();
})
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment