update how view's set titles, closes #337

This commit is contained in:
Adam Bradley
2014-01-12 22:39:10 -06:00
parent 8982a8ad40
commit 3124ef3981
8 changed files with 38 additions and 32 deletions

View File

@@ -21,6 +21,16 @@ describe('Ionic View', function() {
expect(element.hasClass('pane')).toEqual(true);
});
it('should broacast view enter on link', function() {
spyOn(scope, '$broadcast');
var element = compile('<view title="\'Me Title\'"></view>')(scope);
expect(scope.$broadcast).toHaveBeenCalledWith('viewState.viewEnter', { title: 'Me Title', navDirection: undefined });
scope.$navDirection = 'forward';
element = compile('<view title="\'Me Title\'"></view>')(scope);
expect(scope.$broadcast).toHaveBeenCalledWith('viewState.viewEnter', { title: 'Me Title', navDirection: 'forward' });
});
it('should set hide back button', function() {
spyOn(scope, '$broadcast');