Skip to content

Instantly share code, notes, and snippets.

@got5
Created December 16, 2014 21:35
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 got5/4831ca77e3d68db17f54 to your computer and use it in GitHub Desktop.
Save got5/4831ca77e3d68db17f54 to your computer and use it in GitHub Desktop.
Slide 95 TP6 ProductUtilsSpec.js
describe("ProductUtils Service", function () {
var ProductUtils,
comments = [
{
"rate": 2,
"user": "Laurent Wroblewski",
"comment": "Test comment"
},
{
"rate": 4,
"user": "Pierre Marot",
"comment": ""
}
];
beforeEach(function () {
module('app');
inject(function ($injector) {
ProductUtils = $injector.get('ProductUtils');
});
});
it("getRatingCss should return the correct CSS classes as an array", function () {
expect(ProductUtils.getRatingCss(comments)).toEqual(['rating','three']);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment