diff options
| author | Misko Hevery | 2011-01-19 15:42:11 -0800 |
|---|---|---|
| committer | Misko Hevery | 2011-01-24 14:23:51 -0800 |
| commit | c2f2587a79aeb77aad66f081cf924a79348a698e (patch) | |
| tree | 8f5aa4cc6e7189befb834388b2102d1eda88a975 /test/ScenarioSpec.js | |
| parent | 5d0d34ae72a9ca47f1b2dabda60711ad16ee9313 (diff) | |
| download | angular.js-c2f2587a79aeb77aad66f081cf924a79348a698e.tar.bz2 | |
fixed example rendering, add tests for it.
Diffstat (limited to 'test/ScenarioSpec.js')
| -rw-r--r-- | test/ScenarioSpec.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/ScenarioSpec.js b/test/ScenarioSpec.js index 30a3d72a..50b5e51c 100644 --- a/test/ScenarioSpec.js +++ b/test/ScenarioSpec.js @@ -1,14 +1,14 @@ 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('<div ng:init="a=1">{{b=a+1}}</div>')[0]; @@ -17,18 +17,18 @@ describe("ScenarioSpec: Compilation", function(){ expect(scope.a).toEqual(1); expect(scope.b).toEqual(2); }); - + it("should compile jQuery node and return scope", function(){ scope = compile(jqLite('<div>{{a=123}}</div>')).$init(); expect(jqLite(scope.$element).text()).toEqual('123'); }); - + it("should compile text node and return scope", function(){ scope = compile('<div>{{a=123}}</div>').$init(); expect(jqLite(scope.$element).text()).toEqual('123'); }); }); - + describe('scope', function(){ it("should have set, get, eval, $init, updateView methods", function(){ scope = compile('<div>{{a}}</div>').$init(); @@ -39,7 +39,7 @@ describe("ScenarioSpec: Compilation", function(){ scope.$eval(); expect(jqLite(scope.$element).text()).toEqual('3'); }); - + it("should have $ objects", function(){ scope = compile('<div></div>', {$config: {a:"b"}}); expect(scope.$service('$location')).toBeDefined(); @@ -48,7 +48,7 @@ describe("ScenarioSpec: Compilation", function(){ expect(scope.$get('$config.a')).toEqual("b"); }); }); - + describe("configuration", function(){ it("should take location object", function(){ var url = "http://server/#?book=moby"; @@ -61,4 +61,4 @@ describe("ScenarioSpec: Compilation", function(){ expect($location.hashSearch.book).toEqual('moby'); }); }); -});
\ No newline at end of file +}); |
