> 1) Is there any way to get a reference to the connected Model::DBIC
> schema from an external script (e.g. using Test::WWW::Mechanize::Catalyst)?
>
> 2) Is it a totally insane idea to try?

Hopefully someone else has a better way, but I just instantiate the Model 
class myself (with a fake $c, courtesy of Test::MockObject) and use that.  I 
use this technique to simulate a user with Mech (or 
Test::WWW::Catalyst::Selenium), and then check to make sure my data store 
gets updated properly.

You mock object just needs to set $c->config to return a hashref of config, 
and you should be all set to:

$model = MyApp::Model::Whatever->new($c);

and then use $model as though it were returned by $c->model('Whatever').

Regards,
Jonathan Rockway

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;

Attachment: pgpZmTb7UgSae.pgp
Description: PGP signature

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to