diff options
| author | Misko Hevery | 2010-03-26 16:27:18 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-03-26 16:27:18 -0700 |
| commit | 258ca5f16581f0e8befa493644225a02ae2fc002 (patch) | |
| tree | a7d67c586fb5c870619664ca84e17996f6dd2e6d /test/EntityDeclarationTest.js | |
| parent | 1990cbbf2817e04657ccd616da1d9d6b78cc2949 (diff) | |
| download | angular.js-258ca5f16581f0e8befa493644225a02ae2fc002.tar.bz2 | |
moved all uneeded files out, widgets.html works, tests horribly broken
Diffstat (limited to 'test/EntityDeclarationTest.js')
| -rw-r--r-- | test/EntityDeclarationTest.js | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/test/EntityDeclarationTest.js b/test/EntityDeclarationTest.js deleted file mode 100644 index 28986ea8..00000000 --- a/test/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); -}; |
