This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +6
-14
lines changed
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 () {
76
76
expect ( element ( by . css ( '.minerr-errmsg' ) ) . getText ( ) ) . toEqual ( "Argument 'Missing' is not a function, got undefined" ) ;
77
77
} ) ;
78
78
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
+ } ) ;
79
83
80
84
} ) ;
81
85
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
- } ) ;
89
86
} ) ;
Original file line number Diff line number Diff line change @@ -24,20 +24,14 @@ angular.module('DocsController', [])
24
24
$window . _gaq . push ( [ '_trackPageview' , pagePath ] ) ;
25
25
} ) ;
26
26
27
- $scope . $on ( '$includeContentError' , function ( ) {
28
- $scope . partialPath = 'Error404.html' ;
29
- } ) ;
30
-
31
-
32
27
$scope . $watch ( function docsPathWatch ( ) { return $location . path ( ) ; } , function docsPathWatchAction ( path ) {
33
28
34
29
path = path . replace ( / ^ \/ ? ( .+ ?) ( \/ i n d e x ) ? \/ ? $ / , '$1' ) ;
35
30
36
- $scope . partialPath = 'partials/' + path + '.html' ;
37
-
38
31
currentPage = $scope . currentPage = NG_PAGES [ path ] ;
39
32
40
33
if ( currentPage ) {
34
+ $scope . partialPath = 'partials/' + path + '.html' ;
41
35
$scope . currentArea = NG_NAVIGATION [ currentPage . area ] ;
42
36
var pathParts = currentPage . path . split ( '/' ) ;
43
37
var breadcrumb = $scope . breadcrumb = [ ] ;
@@ -50,6 +44,7 @@ angular.module('DocsController', [])
50
44
} else {
51
45
$scope . currentArea = NG_NAVIGATION [ 'api' ] ;
52
46
$scope . breadcrumb = [ ] ;
47
+ $scope . partialPath = 'Error404.html' ;
53
48
}
54
49
} ) ;
55
50
You can’t perform that action at this time.
0 commit comments