Hey Amiri,
Now for the problem. When I go to test this:
my $mech = Test::WWW::Mechanize::Catalyst->new;
ok(my $schema = DBICTest->init_schema(), 'got schema');
my $req = GET("http://localhost/api/rest/artist/list", {
}, 'Accept' => 'text/x-json' );
$mech->request($req);
cmp_ok( $mech->status, '==', 200, 'open attempt okay' );
I just finished building some code around C::C::DBIC::API and ran
into something similar. I'm assuming in this test that you are trying
to get a list of all artists. If so, you should make a GET request
against http://localhost/api/rest/artist. In a REST controller,
artist/list would be asking for the artist whose id is 'list'.
C::C::DBIC::API also doesn't support GET on an individual object out
of the box, but it is easy to add. Just add
sub object_GET :Private {}
in RestTest::ControllerBase::REST. The rest of the code is already
there to retrieve the object and serialize it.
Cheers,
Fitz
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/