aboutsummaryrefslogtreecommitdiffstats
path: root/test/moveToAngularCom/EntityDeclarationTest.js
diff options
context:
space:
mode:
authorAndres Ornelas2010-07-27 10:44:46 -0700
committerAndres Ornelas2010-07-27 10:44:46 -0700
commitb42072733c3afd03a49457d88ffed28ebe55655e (patch)
tree2fa2b8703cdc75fe19a204d2c9677e27d33c8176 /test/moveToAngularCom/EntityDeclarationTest.js
parent2f7c538628929888ce7c99b9577e34f8c87211f7 (diff)
parent8ddee9bb25ade2bbe7d57db6353b29867606c184 (diff)
downloadangular.js-b42072733c3afd03a49457d88ffed28ebe55655e.tar.bz2
Merge branch 'master' of github.com:angular/angular.js into future
Diffstat (limited to 'test/moveToAngularCom/EntityDeclarationTest.js')
-rw-r--r--test/moveToAngularCom/EntityDeclarationTest.js50
1 files changed, 0 insertions, 50 deletions
diff --git a/test/moveToAngularCom/EntityDeclarationTest.js b/test/moveToAngularCom/EntityDeclarationTest.js
deleted file mode 100644
index 28986ea8..00000000
--- a/test/moveToAngularCom/EntityDeclarationTest.js
+++ /dev/null
@@ -1,50 +0,0 @@
-EntityDeclarationTest = TestCase('EntityDeclarationTest');
-
-EntityDeclarationTest.prototype.testEntityTypeOnly = function(){
- expectAsserts(2);
- var datastore = {entity:function(name){
- assertEquals("Person", name);
- }};
- var scope = new Scope();
- var init = scope.entity("Person", datastore);
- assertEquals("", init);
-};
-
-EntityDeclarationTest.prototype.testWithDefaults = function(){
- expectAsserts(4);
- var datastore = {entity:function(name, init){
- assertEquals("Person", name);
- assertEquals("=a:", init.a);
- assertEquals(0, init.b.length);
- }};
- var scope = new Scope();
- var init = scope.entity('Person:{a:"=a:", b:[]}', datastore);
- assertEquals("", init);
-};
-
-EntityDeclarationTest.prototype.testWithName = function(){
- expectAsserts(2);
- var datastore = {entity:function(name, init){
- assertEquals("Person", name);
- return function (){ return {}; };
- }};
- var scope = new Scope();
- var init = scope.entity('friend=Person', datastore);
- assertEquals("$anchor.friend:{friend=Person.load($anchor.friend);friend.$$anchor=\"friend\";};", init);
-};
-
-EntityDeclarationTest.prototype.testMultipleEntities = function(){
- expectAsserts(3);
- var expect = ['Person', 'Book'];
- var i=0;
- var datastore = {entity:function(name, init){
- assertEquals(expect[i], name);
- i++;
- return function (){ return {}; };
- }};
- var scope = new Scope();
- var init = scope.entity('friend=Person;book=Book;', datastore);
- assertEquals("$anchor.friend:{friend=Person.load($anchor.friend);friend.$$anchor=\"friend\";};" +
- "$anchor.book:{book=Book.load($anchor.book);book.$$anchor=\"book\";};",
- init);
-};