@@ -1059,17 +1059,6 @@ describe('ngMock', function() {
1059
1059
expect ( callback ) . toHaveBeenCalledOnceWith ( 200 , 'first' , 'header: val' , 'OK' ) ;
1060
1060
} ) ;
1061
1061
1062
- it ( 'should take function' , function ( ) {
1063
- hb . expect ( 'GET' , '/some' ) . respond ( function ( m , u , d , h ) {
1064
- return [ 301 , m + u + ';' + d + ';a=' + h . a , { 'Connection' : 'keep-alive' } , 'Moved Permanently' ] ;
1065
- } ) ;
1066
-
1067
- hb ( 'GET' , '/some' , 'data' , callback , { a : 'b' } ) ;
1068
- hb . flush ( ) ;
1069
-
1070
- expect ( callback ) . toHaveBeenCalledOnceWith ( 301 , 'GET/some;data;a=b' , 'Connection: keep-alive' , 'Moved Permanently' ) ;
1071
- } ) ;
1072
-
1073
1062
it ( 'should default status code to 200' , function ( ) {
1074
1063
callback . andCallFake ( function ( status , response ) {
1075
1064
expect ( status ) . toBe ( 200 ) ;
@@ -1085,6 +1074,24 @@ describe('ngMock', function() {
1085
1074
expect ( callback . callCount ) . toBe ( 2 ) ;
1086
1075
} ) ;
1087
1076
1077
+ it ( 'should default status code to 200 and provide status text' , function ( ) {
1078
+ hb . expect ( 'GET' , '/url1' ) . respond ( 'first' , { 'header' : 'val' } , 'OK' ) ;
1079
+ hb ( 'GET' , '/url1' , null , callback ) ;
1080
+ hb . flush ( ) ;
1081
+
1082
+ expect ( callback ) . toHaveBeenCalledOnceWith ( 200 , 'first' , 'header: val' , 'OK' ) ;
1083
+ } ) ;
1084
+
1085
+ it ( 'should take function' , function ( ) {
1086
+ hb . expect ( 'GET' , '/some' ) . respond ( function ( m , u , d , h ) {
1087
+ return [ 301 , m + u + ';' + d + ';a=' + h . a , { 'Connection' : 'keep-alive' } , 'Moved Permanently' ] ;
1088
+ } ) ;
1089
+
1090
+ hb ( 'GET' , '/some' , 'data' , callback , { a : 'b' } ) ;
1091
+ hb . flush ( ) ;
1092
+
1093
+ expect ( callback ) . toHaveBeenCalledOnceWith ( 301 , 'GET/some;data;a=b' , 'Connection: keep-alive' , 'Moved Permanently' ) ;
1094
+ } ) ;
1088
1095
1089
1096
it ( 'should default response headers to ""' , function ( ) {
1090
1097
hb . expect ( 'GET' , '/url1' ) . respond ( 200 , 'first' ) ;
0 commit comments