aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMisko Hevery2010-02-04 14:02:20 -0800
committerMisko Hevery2010-02-04 14:02:20 -0800
commit9f919c42f0885e39870195fab8ce2a22621119b7 (patch)
treee125755fd371c9be686763c9e7b1f280363de754 /test
parent1da18e73a4d09b2a1ace92a4094eeba014eb7dc4 (diff)
downloadangular.js-9f919c42f0885e39870195fab8ce2a22621119b7.tar.bz2
better handling of $invalidWidgets
Diffstat (limited to 'test')
-rw-r--r--test/BinderTest.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/test/BinderTest.js b/test/BinderTest.js
index 41319b52..f10ed9b1 100644
--- a/test/BinderTest.js
+++ b/test/BinderTest.js
@@ -3,7 +3,7 @@ BinderTest = TestCase('BinderTest');
function compile(content, initialScope, config) {
var h = html(content);
config = config || {autoSubmit:true};
- var scope = new Scope(initialScope, "ROOT");
+ var scope = new Scope($.extend({$invalidWidgets:[]}, initialScope), "ROOT");
h.data('scope', scope);
var datastore = new DataStore();
var binder = new Binder(h[0], new WidgetFactory(), datastore, new MockLocation(), config);
@@ -875,18 +875,15 @@ BinderTest.prototype.testParseQueryString = function(){
BinderTest.prototype.testSetBinderAnchorTriggersListeners = function(){
expectAsserts(2);
- var doc = html("<div/>")[0];
- var binder = new Binder(doc, null, null, new MockLocation());
- var scope = new Scope({$binder:binder, $anchor:binder.anchor});
- jQuery(doc).data('scope', scope);
+ var doc = compile("<div/>");
- scope.addWatchListener("$anchor.name", function(newVal, oldVal) {
+ doc.scope.addWatchListener("$anchor.name", function(newVal, oldVal) {
assertEquals("new", newVal);
assertEquals(undefined, oldVal);
});
- binder.anchor.name = "new";
- binder.onUrlChange("http://base#name=new");
+ doc.binder.anchor.name = "new";
+ doc.binder.onUrlChange("http://base#name=new");
};
BinderTest.prototype.testItShouldDisplayErrorWhenActionIsSyntacticlyIncorect = function(){