Skip to content

Instantly share code, notes, and snippets.

@m2web
Created June 27, 2013 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m2web/5881300 to your computer and use it in GitHub Desktop.
Save m2web/5881300 to your computer and use it in GitHub Desktop.
Jasmine DateSortSpec1.js
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