Created
September 6, 2012 18:33
-
-
Save uhhuhyeah/3659272 to your computer and use it in GitHub Desktop.
How do I test this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.app.OutFitCollectionView = Backbone.View.extend({ | |
// redacted code for brevity... | |
render: function() { | |
this.collection.each(this.renderOutfit); | |
// redacted code for brevity... | |
return this; | |
}, | |
renderOutfit: function(outfit) { | |
var view = new window.app.OutfitView({model: outfit}); | |
this.$el.append(view.render().el); | |
} | |
}); | |
/* | |
My test is that calling `renderOutfit` should instantiate a new OutfitView and append it's el to | |
the collectionView's el. | |
I'd like to spy on the OutfitView's el and have it return some simple markup I can than check is | |
the collectionView's $el but spys are for functions, not properties. | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment