Skip to content
Extraits de code Groupes Projets
Valider cd965e32 rédigé par Florian Staudacher's avatar Florian Staudacher
Parcourir les fichiers

fix comment stream jasmine - bind function after spy has been defined

parent b3868fc6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -14,7 +14,11 @@ app.views.CommentStream = app.views.Base.extend({ ...@@ -14,7 +14,11 @@ app.views.CommentStream = app.views.Base.extend({
this.model.comments.bind('add', this.appendComment, this); this.model.comments.bind('add', this.appendComment, this);
this.commentTemplate = options.commentTemplate; this.commentTemplate = options.commentTemplate;
this.model.bind("commentsExpanded", this.render, this) this.setupBindings();
},
setupBindings: function() {
this.model.bind("commentsExpanded", this.render, this);
}, },
postRenderTemplate : function() { postRenderTemplate : function() {
......
...@@ -6,9 +6,10 @@ describe("app.views.CommentStream", function(){ ...@@ -6,9 +6,10 @@ describe("app.views.CommentStream", function(){
describe("binds", function() { describe("binds", function() {
it("re-renders on a commentsExpanded trigger", function(){ it("re-renders on a commentsExpanded trigger", function(){
spyOn(this.view, "render") spyOn(this.view, "render");
this.view.model.trigger("commentsExpanded") this.view.setupBindings();
expect(this.view.render).toHaveBeenCalled() this.view.model.trigger("commentsExpanded");
expect(this.view.render).toHaveBeenCalled();
}) })
}) })
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter