ColdBox Platform: http://www.coldbox.org
ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On Tuesday, December 2, 2014 at 8:59 AM, Ben Densmore wrote:
Hi Luis,I've tried a couple of different ways based off of what's in http://wiki.coldbox.org/wiki/Recipes%3ABasic_HTTP_Authentication/wiki/MockBox.cfmThe API I'm building expects a key/value pair of "Authorization": "basic 123456" where the 123456 is a Hashed value. I'm just not sure how best to make that work in my test.I've tried a couple of variations like the following, but I'm just totally guessing since Mocking is something I've never done before and still trying to fully understand it(which I don't). So please excuse how badly off I may be on how to do this:it( "should return a version number", function(){var mockEvent = getMockRequestContext();
mockEvent.$("getHTTPHeader").$args("Authorization").$results("").$("setHTTPHeader");var event = execute( event="version.index", renderResults=true );expect( event.getRenderData().data ).toHaveKey( "message" );expect( event.getRenderData().data[ "message" ] ).toBe( "Version 2.0.0" );});I've also tried doing something with getMockBox().prepareMock( getRequestContext() ).$("setHTTPHeader") but with no luck and have also tried using cfheader as well.Any wisdom on how best to accomplish this would be greatly appreciated.
ColdBox Platform: http://www.coldbox.org
ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox