From ef4bb28be13e99f96c9ace5936cf26a174a0e5f0 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Sat, 12 Feb 2011 10:13:28 -0800 Subject: Change API angular.compile(element)([scope], [element/true]) --- test/ScenarioSpec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/ScenarioSpec.js') diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js index cd1e3115..ce8ce69c 100644 --- a/test/ScenarioSpec.js +++ b/test/ScenarioSpec.js @@ -12,25 +12,25 @@ describe("ScenarioSpec: Compilation", function(){ describe('compilation', function(){ it("should compile dom node and return scope", function(){ var node = jqLite('
{{b=a+1}}
')[0]; - scope = compile(node); + scope = angular.compile(node)().scope; expect(scope.a).toEqual(1); expect(scope.b).toEqual(2); }); it("should compile jQuery node and return scope", function(){ - scope = compile(jqLite('
{{a=123}}
')); + scope = compile(jqLite('
{{a=123}}
'))().scope; expect(jqLite(scope.$element).text()).toEqual('123'); }); it("should compile text node and return scope", function(){ - scope = compile('
{{a=123}}
'); + scope = angular.compile('
{{a=123}}
')().scope; expect(jqLite(scope.$element).text()).toEqual('123'); }); }); describe('scope', function(){ it("should have $set, $get, $eval, $updateView methods", function(){ - scope = compile('
{{a}}
'); + scope = angular.compile('
{{a}}
')().scope; scope.$eval("$invalidWidgets.push({})"); expect(scope.$set("a", 2)).toEqual(2); expect(scope.$get("a")).toEqual(2); @@ -40,7 +40,7 @@ describe("ScenarioSpec: Compilation", function(){ }); it("should have $ objects", function(){ - scope = compile('
', {$config: {a:"b"}}); + scope = angular.compile('
')(angular.scope({$config: {a:"b"}})).scope; expect(scope.$service('$location')).toBeDefined(); expect(scope.$get('$eval')).toBeDefined(); expect(scope.$get('$config')).toBeDefined(); @@ -51,7 +51,7 @@ describe("ScenarioSpec: Compilation", function(){ describe("configuration", function(){ it("should take location object", function(){ var url = "http://server/#?book=moby"; - scope = compile("
{{$location}}
"); + scope = angular.compile("
{{$location}}
")().scope; var $location = scope.$service('$location'); var $browser = scope.$service('$browser'); expect($location.hashSearch.book).toBeUndefined(); -- cgit v1.2.3