We're updating the issue view to help you get more done. 

JSON reporter fails for integration tests with cfhtmlhead and cfheader

Description

if testing an handler with

1 2 3 4 5 function pageNotFound(event, rc, prc) { cfhtmlhead( text='<script src="#getAsset("/assets/jstree.min.js")#" type="text/javascript"></script>' ); // Set a page for rendering and a 404 header event.setView( "error/404" ).setHTTPHeader( "404", "Page Not Found" ); }

and a test like this

1 2 3 4 5 it( "+nicht existente Seite soll die 404 Seite anzeigen", function(){ var event = execute( route="/page-not-found-test",renderResults=true ); var html = event.getRenderedContent(); expect( html ).toInclude( "<span>404</span>"); });

the json reporter will fail

as a quick fix, add this to the json reporter

1 2 3 4 // reset cfhtmlhead from integration tests getPageContext().getOut().resetHTMLHead(); // reset cfheader from integration tests getPageContext().getResponse().reset();

 

Status

Assignee

Luis Majano

Reporter

Andreas Eppinger

Labels

None

Priority

Major