Skip to content

Instantly share code, notes, and snippets.

@haingdc
Created March 27, 2018 09:55
Show Gist options
  • Save haingdc/9cf3452c60a3b9c78b1d30d685a1c562 to your computer and use it in GitHub Desktop.
Save haingdc/9cf3452c60a3b9c78b1d30d685a1c562 to your computer and use it in GitHub Desktop.
get start with tdd
// flickr-fetcher-spec.js
describe('#photoObjToURL()', function() {
it('should take a photo object from Flickr and return a string', function() {
var input = {
id: '24770505034',
owner: '97248275@N03',
secret: '31a9986429',
server: '1577',
farm: 2,
title: '20160229090898',
ispublic: 1,
isfriend: 0,
isfamily: 0
};
var expected = 'https://farm2.staticflickr.com/1577/24770505034_31a9986429_b.jpg';
var actual = FlickrFetcher.photoObjToURL(input);
expect(actual).to.eql(expected);
input = {
id: '24770504484',
owner: '97248275@N03',
secret: '69dd90d5dd',
server: '1451',
farm: 2,
title: '20160229090903',
ispublic: 1,
isfriend: 0,
isfamily: 0
};
expected = 'https://farm2.staticflickr.com/1451/24770504484_69dd90d5dd_b.jpg';
actual = FlickrFetcher.photoObjToURL(input);
expect(actual).to.eql(expected);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment