Problem with wirebox inside unit tests

Before upgrading to wireBox I actually had no problem with these tests, but now I get a variable not found.

First I have all my tests in a directory called unitTests, all other tests work except any that use the Execute(event). The unit tests directory is not in the webroot, and has all the correct mappings etc.

The problem that I see it as is that the mappings or bindings so to speak are getting confused, that’s the only way that I can describe this.

So if I have something like the following in my tests.

var event = execute(‘module:Comment.index’);

var result = event.getRenderData();

assertEquals(‘ok’, result.data.status, ‘Was not able to create a comment.’ );

The event is fired and is run, but anything that should be DI’ed into the handler is not.

So the question is how should this work? Or more importantly do I need to do something special on the tests side for WireBox to do its magic?

The unitTests directory has an application.cfc that has a different name to the main application, and the remoteFacade also resides in this directory, if that helps and all the settings are correct for all other tests to work, just not in this scenario.

Regards,

Andrew Scott

http://www.andyscott.id.au/

Can you post the errors Andrew, everything should load, so not really sure what your issue is.
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

The error is a standard variable pageService doesn’t exist, this is a DI property that is in the vent.

I am thinking that because the Application.cfc is inside the unitTests dir, that wireBox might be getting confused as to where to find the conventions, but I am only getting this problem with running events, everything else like getModel() will do the DI just fine.

Regards,

Andrew Scott

http://www.andyscott.id.au/