From 3d388498e5c8920ca3c88d3ee1eccefcfcf99626 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Mon, 11 Apr 2011 08:04:16 -0700 Subject: add test for ng:view sync cache regression test for 9bd2c396 --- test/widgetsSpec.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'test/widgetsSpec.js') diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index 8d3e0456..3cada77b 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -885,6 +885,45 @@ describe("widget", function(){ expect($route.current.template).toEqual('viewPartial.html'); dealoc($route.current.scope); }); + + + it('should initialize view template after the view controller was initialized even when ' + + 'templates were cached', function() { + //this is a test for a regression that was introduced by making the ng:view cache sync + + $route.when('/foo', {controller: ParentCtrl, template: 'viewPartial.html'}); + + rootScope.log = []; + + function ParentCtrl() { + this.log.push('parent'); + } + + rootScope.ChildCtrl = function() { + this.log.push('child'); + } + + $location.updateHash('/foo'); + $browser.xhr.expectGET('viewPartial.html'). + respond('