Created
June 27, 2013 23:32
-
-
Save m2web/5881300 to your computer and use it in GitHub Desktop.
Jasmine DateSortSpec1.js
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
describe("Sort by Date", function() { | |
var dateSort; | |
var booksData; | |
beforeEach(function() { | |
dateSort = new DateSort(); | |
booksData = [ | |
{ | |
title: 'Health for a friend', | |
author: 'John Doe', | |
publishDate: '01/01/2013' | |
}, | |
{ | |
title: 'A Million Biliion Dollars', | |
author: 'James Dean', | |
publishDate: '03/15/2013' | |
}, | |
{ | |
title: 'Wisdom', | |
author: 'Tom Thumb', | |
publishDate: '06/03/2013' | |
} | |
]; | |
}); | |
it("should show Health for a Friend title with ascending sort", function() { | |
var sortedAsc = dateSort.sortAsc(booksData); | |
var sortedTitle = sortedAsc[0]['title']; | |
expect(sortedTitle).toEqual('Health for a friend'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment