I’m sure this has been answered before - and I searched the forum but to be honest I don’t know the terms to search for!
TL:DR -> I’m running a test against Something/index but event.getCollection() only contains rc vars from the requestStartHandler
start / test function body ----
var event = “”;
event = execute(“Something/index”);
debug(event.getCollection());
end / test function body ----
The index method in the Something handler sets some variables into the rc scope (shhhh I’m writing the test after I’ve written the actual code)
But all I see in the debug call above is variables set into the rc scope from the requestStartHandler -> Main.index
Of course this behaviour IS NOT happening in the main app - only via the test
so a question for coldbox/mxunit-ers … what could I be doing in my test/Application.cfc that would cause this? I presume that is the only place this config change could be occurring?
I’ve removed all my handlers, views and tests and am adding them back in little by little (tests first!)
I hit a similar (s i m i l a r) issue when I add “GET” to the allowedMethods for the index key in the handler. Could this have been my issue? ie. mxunit somehow isn’t doing a GET that coldbox recognises?
I don’t know enough about the internals of coldbox to answer that BUT it fails when ONLY GET is there, but passes when POST is added.
My handler method was (correctly) setup to only allow HTTP GET access.
Obviously mxunit must use POST under the covers (I haven’t busted out a HTTP sniffer to confirm this) and so the call to the action was being silently lost.
Seeding this post with the keywords for the next poor sap that runs into this issue won’t help. sigh.