various bug fixes

This commit is contained in:
Misko Hevery
2010-04-09 16:20:15 -07:00
parent 41a5c408c2
commit 843bd355d2
18 changed files with 304 additions and 165 deletions

View File

@@ -207,13 +207,18 @@ describe("input widget", function(){
describe('ng:switch', function(){
it("should match urls", function(){
var scope = compile('<ng:switch on="url" using="route"><div ng-switch-when="/Book/:name">{{name}}</div></ng:include>');
var scope = compile('<ng:switch on="url" using="route:params"><div ng-switch-when="/Book/:name">{{params.name}}</div></ng:include>');
scope.url = '/Book/Moby';
scope.$init();
// jstestdriver.console.log('text');
expect(scope.$element.text()).toEqual('Moby');
});
it("should match sandwich ids", function(){
var scope = {};
var match = angular.widget['NG:SWITCH'].route.call(scope, '/a/123/b', '/a/:id');
expect(match).toBeFalsy();
});
it('should call init on switch', function(){
var scope = compile('<ng:switch on="url" change="name=\'works\'"><div ng-switch-when="a">{{name}}</div></ng:include>');
scope.url = 'a';