This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -76,14 +76,11 @@ describe('docs.angularjs.org', function () {
7676 expect ( element ( by . css ( '.minerr-errmsg' ) ) . getText ( ) ) . toEqual ( "Argument 'Missing' is not a function, got undefined" ) ;
7777 } ) ;
7878
79+ it ( "should display an error if the page does not exist" , function ( ) {
80+ browser . get ( 'index-debug.html#!/api/does/not/exist' ) ;
81+ expect ( element ( by . css ( 'h1' ) ) . getText ( ) ) . toBe ( 'Oops!' ) ;
82+ } ) ;
7983
8084 } ) ;
8185
82- } ) ;
83-
84- describe ( 'Error Handling' , function ( ) {
85- it ( "should display an error if the page does not exist" , function ( ) {
86- browser . get ( 'index-debug.html#!/api/does/not/exist' ) ;
87- expect ( element ( by . css ( 'h1' ) ) . getText ( ) ) . toBe ( 'Oops!' ) ;
88- } ) ;
8986} ) ;
Original file line number Diff line number Diff line change @@ -24,20 +24,14 @@ angular.module('DocsController', [])
2424 $window . _gaq . push ( [ '_trackPageview' , pagePath ] ) ;
2525 } ) ;
2626
27- $scope . $on ( '$includeContentError' , function ( ) {
28- $scope . partialPath = 'Error404.html' ;
29- } ) ;
30-
31-
3227 $scope . $watch ( function docsPathWatch ( ) { return $location . path ( ) ; } , function docsPathWatchAction ( path ) {
3328
3429 path = path . replace ( / ^ \/ ? ( .+ ?) ( \/ i n d e x ) ? \/ ? $ / , '$1' ) ;
3530
36- $scope . partialPath = 'partials/' + path + '.html' ;
37-
3831 currentPage = $scope . currentPage = NG_PAGES [ path ] ;
3932
4033 if ( currentPage ) {
34+ $scope . partialPath = 'partials/' + path + '.html' ;
4135 $scope . currentArea = NG_NAVIGATION [ currentPage . area ] ;
4236 var pathParts = currentPage . path . split ( '/' ) ;
4337 var breadcrumb = $scope . breadcrumb = [ ] ;
@@ -50,6 +44,7 @@ angular.module('DocsController', [])
5044 } else {
5145 $scope . currentArea = NG_NAVIGATION [ 'api' ] ;
5246 $scope . breadcrumb = [ ] ;
47+ $scope . partialPath = 'Error404.html' ;
5348 }
5449 } ) ;
5550
You can’t perform that action at this time.
0 commit comments