From: Luke Saunders Date: Fri, 2 Jun 2006 19:29:48 +0000 (+0000) Subject: added failing test case X-Git-Tag: v0.07002~75^2~130^2~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b253a82b90c25b5e35723a8fdd6e300decd01b94;p=dbsrgits%2FDBIx-Class.git added failing test case --- diff --git a/t/90join_torture.t b/t/90join_torture.t index eb66445..e6510e4 100644 --- a/t/90join_torture.t +++ b/t/90join_torture.t @@ -7,15 +7,21 @@ use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 4; +plan tests => 5; my $rs1 = $schema->resultset("Artist")->search({ 'tags.tag' => 'Blue' }, { join => {'cds' => 'tracks'}, prefetch => {'cds' => 'tags'} }); my @artists = $rs1->all; cmp_ok(@artists, '==', 1, "Two artists returned"); my $rs2 = $rs1->search({ artistid => '1' }, { join => {'cds' => {'cd_to_producer' => 'producer'} } }); -my $rs3 = $rs2->search_related('cds')->search({'cds.title' => 'Forkful of bees'}); -cmp_ok($rs3->count, '==', 3, "Three artists returned"); + +my @artists2 = $rs2->search({ 'producer.name' => 'Matt S Trout' }); +my @cds = $artists2[0]->cds; +cmp_ok(scalar @cds, '==', 1, "condition based on inherited join okay"); + +my $rs3 = $rs2->search_related('cds')->search({'title' => 'Forkful of bees'}); +cpm_ok($rs3->count, '==', 3, "Three artists returned"); +exit; my $rs4 = $schema->resultset("CD")->search({ 'artist.artistid' => '1' }, { join => ['tracks', 'artist'], prefetch => 'artist' }); my @rs4_results = $rs4->all;