Skip to content

Commit

Permalink
test for numberString filter
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesjwarren committed Feb 3, 2015
1 parent 91c2c2f commit 6bb010d
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tests/unit/thisissoon-nav/numberString.js
@@ -0,0 +1,27 @@
"use strict";

describe("snNumberString", function() {
var scope, rootScope, filter;

beforeEach(module("thisissoon.nav"));

beforeEach(inject(function ($rootScope, $filter, $injector) {
scope = $rootScope.$new();

rootScope = $rootScope;

filter = $filter("snNumberString");

}));

it("should return test representation of numbers between 1 and 10", function(){

var numberStrings = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"];

for(var i = 1; i<=10; i++){
var result = filter(i);
expect(result).toEqual(numberStrings[i]);
}
});

});

0 comments on commit 6bb010d

Please sign in to comment.