Really wanting to set up some test cases, but with the SES enabled, anytime I try to go to my /tests folder, which contains an index.cfm, all I get is an error that “tests” isn’t a valid handler.
When dump arguments.targetPage in onRequestStart, even when trying /tests/tests.cfm, I always see index.cfm.
Is there some way to exclude a folder from being interpreted as a route? I have the IIS 7 web.config section loaded as detailed in setting up the SES enabled Coldbox app. Is it something in this config that needs to be changed? It would seem to me that if a URL contains “anything.cfm”, that the web.config rules should be configured to not override the “anything.cfm” with “index.cfm”.
I can’t possibly be the first person to encounter this issue.
Okay, let me amend that. I had actually removed the /tests folder! So I put it back up, and had this behavior:
/tests/index.cfm just showed the normal home page of my site. No error about a missing tests handler, just seemed to run the default event.
/tests/test.cfm showed the test.cfm page, as expected. (Except I had to add tags around everything.
So, what is the right procedure to getting Testbox setup to run mxunit-style tests. I dug through the docs the other day, tried 80 things and finally threw my hands in the air. I have some time this morning, so thought I’d give it another stab. (I’ve found it’s much easier to right new components with test cases than trying to integrate it into my app to find the breakage. (Is that test-driven development? Luis and Dirk, you won this round!)
do you use rewrite rules? That is the best place to do that.
Something like this for .htaccess
RewriteRule ^(mxunit|unitTests) - [L,NC]