Skip to content

Instantly share code, notes, and snippets.

@jessemiller
Created August 8, 2011 02:07
Show Gist options
  • Save jessemiller/1131088 to your computer and use it in GitHub Desktop.
Save jessemiller/1131088 to your computer and use it in GitHub Desktop.
Fourth step of test-driven javascript
test("After /bananas returns a json struct, banana-selector should be populated", function() {
var fakeBananaJson = [{id:5, color:"yellow"},{id:2, color:"green"}]
var fakeAjax = function( params ) {
params.success( fakeBananaJson );
}
var populator = new tdd.BananaPopulator({
ajax: fakeAjax
});
equal( $('#banana-selector option').length, 2, 'There should be 2 options on the banana selector' );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment