Skip to content

Instantly share code, notes, and snippets.

@JontyMC
JontyMC / Given.js
Last active December 30, 2015 03:29
'Given the flickr api returns 3 items'._(function () {
// Using builder pattern here is overkill, but important for
// scenarios with complex data dependencies
flickrItems = new FlickrItemBuilder().times(3);
mockHttp.uri('http://api.flickr.com/services/feeds/photos_public.gne')
.withData(function (data) {
return data.tags === 'mount ranier'
&& data.tagmode === 'any'
&& data.format === 'json'