Subject: | the WWW::Mechanize put method doesn't seem to work with this subclass |
trying the following code in a catalyst test file the non catalyst mech
object works fine populating the $c->request->body as expected. Using
Catalyst::Controller::REST. The catalyst subclass object however does
not populate the body as expected. This is a severe limitation for
testing restful catalyst apps.
# working Test::WWW::Mechanize code
my $mech = Test::WWW::Mechanize->new();
$mech->get_ok('http://localhost:3000/test');
$mech->content_is('{"result":"none submitted"}');
my $response = $mech->put('http://localhost:3000/test', content =>
'{"tests":[ {
like($response->content, qr/"result":"submit successful"/);
# not working Test::WWW::Mechanize::Catalyst code
my $mech = Test::WWW::Mechanize::Catalyst->new();
$mech->get_ok('http://localhost:3000/test');
$mech->content_is('{"result":"none submitted"}');
my $response = $mech->put('http://localhost:3000/test', content =>
'{"tests":[ {
like($response->content, qr/"result":"submit successful"/);
If I get time I may try to provide a patch for this but if you can beat
me to it I'm sure plenty of folks would appreciate it.