@@ -9,7 +9,7 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" {
99 describe ( " debug spec" , function () {
1010 it ( " can print out information about the cfhttp call that will be made" , function () {
1111 var binaryBody = charsetDecode ( " some binary body" , " utf-8" );
12- var debugReq = hyper
12+ var req = hyper
1313 .withHeaders ( {
1414 " Accept" : " application/json;odata=verbose" ,
1515 " Authorization" : " Bearer token" ,
@@ -19,8 +19,9 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" {
1919 .setBody ( binaryBody )
2020 .setBodyFormat ( " other|binary" )
2121 .setMethod ( " POST" )
22- .setUrl ( " https://example.com" )
23- .debug ();
22+ .setUrl ( " https://example.com" );
23+
24+ var debugReq = req .debug ();
2425
2526 expect ( debugReq ).toBeStruct ();
2627
@@ -52,7 +53,7 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" {
5253 return compare ( a .name , b .name );
5354 } );
5455 expect ( headers ).toBeArray ();
55- expect ( headers ).toHaveLength ( 3 );
56+ expect ( headers ).toHaveLength ( 4 );
5657
5758 expect ( headers [ 1 ] ).toBeStruct ();
5859 expect ( headers [ 1 ] ).toHaveKey ( " name" );
@@ -71,6 +72,12 @@ component extends="tests.resources.ModuleIntegrationSpec" appMapping="/app" {
7172 expect ( headers [ 3 ].name ).toBe ( " Content-Type" );
7273 expect ( headers [ 3 ] ).toHaveKey ( " value" );
7374 expect ( headers [ 3 ].value ).toBe ( " application/octet-stream" );
75+
76+ expect ( headers [ 4 ] ).toBeStruct ();
77+ expect ( headers [ 4 ] ).toHaveKey ( " name" );
78+ expect ( headers [ 4 ].name ).toBe ( " User-Agent" );
79+ expect ( headers [ 4 ] ).toHaveKey ( " value" );
80+ expect ( headers [ 4 ].value ).toBe ( " HyperCFML/#req .getHyperVersion () #" );
7481 } );
7582 } );
7683 }
0 commit comments