diff options
| author | Misko Hevery | 2011-06-20 13:50:46 -0700 |
|---|---|---|
| committer | Igor Minar | 2011-06-23 08:12:01 -0700 |
| commit | b74163dc1d321b878222a751f23adb0a9f6beda5 (patch) | |
| tree | e42f66a63caadf94c4bd74530062cc5deee6469b /test/ApiSpecs.js | |
| parent | bad62d87a1785f11b0df72ad597b9064517997cf (diff) | |
| download | angular.js-b74163dc1d321b878222a751f23adb0a9f6beda5.tar.bz2 | |
fix:$orderBy - return unsorted array if no predicate
Closes #399
Diffstat (limited to 'test/ApiSpecs.js')
| -rw-r--r-- | test/ApiSpecs.js | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/test/ApiSpecs.js b/test/ApiSpecs.js index 2fd51873..f50f22cd 100644 --- a/test/ApiSpecs.js +++ b/test/ApiSpecs.js @@ -160,15 +160,14 @@ describe('api', function(){ }); describe('orderBy', function(){ - var orderBy = angular.Array.orderBy; - - it('ShouldSortArray', function(){ - assertEquals([2,15], angular.Array.orderBy([15,2])); - assertEquals(["a","B", "c"], angular.Array.orderBy(["c","B", "a"])); - assertEquals([15,"2"], angular.Array.orderBy([15,"2"])); - assertEquals(["15","2"], angular.Array.orderBy(["15","2"])); - assertJsonEquals([{a:2},{a:15}], angular.Array.orderBy([{a:15},{a:2}], 'a')); - assertJsonEquals([{a:2},{a:15}], angular.Array.orderBy([{a:15},{a:2}], 'a', "F")); + var orderBy; + beforeEach(function(){ + orderBy = angular.Array.orderBy; + }); + + it('should return same array if predicate is falsy', function(){ + var array = [1, 2, 3]; + expect(orderBy(array)).toBe(array); }); it('ShouldSortArrayInReverse', function(){ |
