aboutsummaryrefslogtreecommitdiffstats
path: root/test/AngularSpec.js
diff options
context:
space:
mode:
authorMisko Hevery2011-04-12 13:40:23 -0700
committerMisko Hevery2011-06-08 15:01:32 -0700
commit2a12f7dcaa078e1d6c3b5092e62dd5f404b8c3e4 (patch)
treebc0b46a0f3949f444b55dae92ee44ed0f6d88aa4 /test/AngularSpec.js
parent20ce797906bf20cfb1682a6bd1bb23c02aedc369 (diff)
downloadangular.js-2a12f7dcaa078e1d6c3b5092e62dd5f404b8c3e4.tar.bz2
Added nextUid() function for unified way of generating IDs in angular
Diffstat (limited to 'test/AngularSpec.js')
-rw-r--r--test/AngularSpec.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js
index b58705cc..4ab14580 100644
--- a/test/AngularSpec.js
+++ b/test/AngularSpec.js
@@ -582,4 +582,20 @@ describe('angular', function(){
});
}
});
+
+
+ describe('nextUid()', function(){
+ it('should return new id per call', function(){
+ var seen = {};
+ var count = 100;
+
+ while(count--) {
+ var current = nextUid();
+ expect(current.match(/[\d\w]+/)).toBeTruthy();
+ expect(seen[current]).toBeFalsy();
+ seen[current] = true;
+ }
+ });
+ });
+
});