Skip Menu |

This queue is for tickets about the Test-WWW-Mechanize-Catalyst CPAN distribution.

Report information
The Basics
Id: 33761
Status: resolved
Priority: 0/
Queue: Test-WWW-Mechanize-Catalyst

People
Owner: Nobody in particular
Requestors: Jeremy [...] marzhillstudios.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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.
If you have time, I'd love a patch.
this is a bug in older HTTP::Request::Common, not with TWMC. before LWP 5.811, HTTP::Request::Common::PUT did not add a content-length header.
This has been resolved by depending on a more recent version of LWP + associated modules.