aboutsummaryrefslogtreecommitdiffstats
path: root/test/ApiSpecs.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ApiSpecs.js')
-rw-r--r--test/ApiSpecs.js17
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(){