diff options
| author | Rob Spies | 2010-06-22 17:09:55 -0700 |
|---|---|---|
| committer | Rob Spies | 2010-06-22 17:09:55 -0700 |
| commit | 1500e91defa4020bfe9608749b25e585cd1d8e3d (patch) | |
| tree | 8c2872252b62567dc4eb00f7d7547661d5674c55 /test/moveToAngularCom/MiscTest.js | |
| parent | eaa397c76b7d28343cde9f3a0338b9b0e79197c8 (diff) | |
| parent | b129a1094e6b42ed82c3ccecc2f40daaa0a6cb6a (diff) | |
| download | angular.js-1500e91defa4020bfe9608749b25e585cd1d8e3d.tar.bz2 | |
Merge http://github.com/angular/angular.js into angular
Conflicts:
.gitignore
Diffstat (limited to 'test/moveToAngularCom/MiscTest.js')
| -rw-r--r-- | test/moveToAngularCom/MiscTest.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/moveToAngularCom/MiscTest.js b/test/moveToAngularCom/MiscTest.js new file mode 100644 index 00000000..aa0e1186 --- /dev/null +++ b/test/moveToAngularCom/MiscTest.js @@ -0,0 +1,35 @@ +BinderTest.prototype.testExpandEntityTagWithName = function(){ + var c = this.compile('<div ng-entity="friend=Person"/>'); + assertEquals( + '<div ng-entity="friend=Person" ng-watch="$anchor.friend:{friend=Person.load($anchor.friend);friend.$$anchor=\"friend\";};"></div>', + sortedHtml(c.node)); + assertEquals("Person", c.scope.$get("friend.$entity")); + assertEquals("friend", c.scope.$get("friend.$$anchor")); +}; + +BinderTest.prototype.testExpandSubmitButtonToAction = function(){ + var html = this.compileToHtml('<input type="submit" value="Save">'); + assertTrue(html, html.indexOf('ng-action="$save()"') > 0 ); + assertTrue(html, html.indexOf('ng-bind-attr="{"disabled":"{{$invalidWidgets}}"}"') > 0 ); +}; + +BinderTest.prototype.testReplaceFileUploadWithSwf = function(){ + expectAsserts(1); + var form = jQuery("body").append('<div id="testTag"><input type="file"></div>'); + form.data('scope', new Scope()); + var factory = {}; + var binder = new Binder(form.get(0), factory, new MockLocation()); + factory.createController = function(node){ + assertEquals(node.attr('type'), 'file'); + return {updateModel:function(){}}; + }; + binder.compile(); + jQuery("#testTag").remove(); +}; + +BinderTest.prototype.testExpandEntityTagWithDefaults = function(){ + assertEquals( + '<div ng-entity="Person:{a:\"a\"}" ng-watch=""></div>', + this.compileToHtml('<div ng-entity=\'Person:{a:"a"}\'/>')); +}; + |
