'use strict'; describe("ScenarioSpec: Compilation", function(){ var scope; beforeEach(function(){ scope = null; }); afterEach(function(){ dealoc(scope); }); describe('compilation', function(){ it("should compile dom node and return scope", function(){ var node = jqLite('
{{b=a+1}}
')[0]; scope = angular.compile(node)(); scope.$digest(); 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.$digest(); expect(jqLite(scope.$element).text()).toEqual('123'); }); it("should compile text node and return scope", function(){ scope = angular.compile('
{{a=123}}
')(); scope.$digest(); expect(jqLite(scope.$element).text()).toEqual('123'); }); }); });