@@ -1045,7 +1045,7 @@ describe('$http', function() {
1045
1045
$http ( { method : 'JSONP' , url : 'http://example.org/path' } )
1046
1046
. catch ( function ( e ) { error = e ; } ) ;
1047
1047
$rootScope . $digest ( ) ;
1048
- expect ( error . message ) . toContain ( '[ $sce: insecurl] ') ;
1048
+ expect ( error ) . toEqualMinErr ( ' $sce' , ' insecurl') ;
1049
1049
} ) ;
1050
1050
1051
1051
it ( 'should accept an explicitly trusted resource url' , function ( ) {
@@ -1066,41 +1066,41 @@ describe('$http', function() {
1066
1066
$http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( 'http://example.org/path?callback=JSON_CALLBACK' ) } )
1067
1067
. catch ( function ( e ) { error = e ; } ) ;
1068
1068
$rootScope . $digest ( ) ;
1069
- expect ( error . message ) . toContain ( '[ $http: badjsonp] ') ;
1069
+ expect ( error ) . toEqualMinErr ( ' $http' , ' badjsonp') ;
1070
1070
1071
1071
error = undefined ;
1072
1072
$http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( 'http://example.org/path?other=JSON_CALLBACK' ) } )
1073
1073
. catch ( function ( e ) { error = e ; } ) ;
1074
1074
$rootScope . $digest ( ) ;
1075
- expect ( error . message ) . toContain ( '[ $http: badjsonp] ') ;
1075
+ expect ( error ) . toEqualMinErr ( ' $http' , ' badjsonp') ;
1076
1076
} ) ;
1077
1077
1078
1078
it ( 'should error if a param contains a JSON_CALLBACK value' , function ( ) {
1079
1079
var error ;
1080
1080
$http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( 'http://example.org/path' ) , params : { callback : 'JSON_CALLBACK' } } )
1081
1081
. catch ( function ( e ) { error = e ; } ) ;
1082
1082
$rootScope . $digest ( ) ;
1083
- expect ( error . message ) . toContain ( '[ $http: badjsonp] ') ;
1083
+ expect ( error ) . toEqualMinErr ( ' $http' , ' badjsonp') ;
1084
1084
1085
1085
error = undefined ;
1086
1086
$http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( 'http://example.org/path' ) , params : { other : 'JSON_CALLBACK' } } )
1087
1087
. catch ( function ( e ) { error = e ; } ) ;
1088
1088
$rootScope . $digest ( ) ;
1089
- expect ( error . message ) . toContain ( '[ $http: badjsonp] ') ;
1089
+ expect ( error ) . toEqualMinErr ( ' $http' , ' badjsonp') ;
1090
1090
} ) ;
1091
1091
1092
1092
it ( 'should error if there is already a param matching the jsonpCallbackParam key' , function ( ) {
1093
1093
var error ;
1094
1094
$http ( { method : 'JSONP' , url : $sce . trustAsResourceUrl ( 'http://example.org/path' ) , params : { callback : 'evilThing' } } )
1095
1095
. catch ( function ( e ) { error = e ; } ) ;
1096
1096
$rootScope . $digest ( ) ;
1097
- expect ( error . message ) . toContain ( '[ $http: badjsonp] ') ;
1097
+ expect ( error ) . toEqualMinErr ( ' $http' , ' badjsonp') ;
1098
1098
1099
1099
error = undefined ;
1100
1100
$http ( { method : 'JSONP' , jsonpCallbackParam : 'cb' , url : $sce . trustAsResourceUrl ( 'http://example.org/path' ) , params : { cb : 'evilThing' } } )
1101
1101
. catch ( function ( e ) { error = e ; } ) ;
1102
1102
$rootScope . $digest ( ) ;
1103
- expect ( error . message ) . toContain ( '[ $http: badjsonp] ') ;
1103
+ expect ( error ) . toEqualMinErr ( ' $http' , ' badjsonp') ;
1104
1104
} ) ;
1105
1105
} ) ;
1106
1106
0 commit comments