Created
August 8, 2011 02:07
-
-
Save jessemiller/1131088 to your computer and use it in GitHub Desktop.
Fourth step of test-driven javascript
This file contains 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
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