X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F90join_torture.t;h=5ab2b838613ef224716a4b66e09dbe6c6a5ecc85;hb=00a80124c31c66230ee825d6bfea040baf9a65ff;hp=e6510e4337efabdbb77b15a05ba9d1349d0816e1;hpb=b253a82b90c25b5e35723a8fdd6e300decd01b94;p=dbsrgits%2FDBIx-Class.git diff --git a/t/90join_torture.t b/t/90join_torture.t index e6510e4..5ab2b83 100644 --- a/t/90join_torture.t +++ b/t/90join_torture.t @@ -7,7 +7,10 @@ use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 5; +plan tests => 6; + +my @rs1a_results = $schema->resultset("Artist")->search_related('cds', {title => 'Forkful of bees'}, {order_by => 'title'}); +is($rs1a_results[0]->title, 'Forkful of bees', "bare field conditions okay after search related"); my $rs1 = $schema->resultset("Artist")->search({ 'tags.tag' => 'Blue' }, { join => {'cds' => 'tracks'}, prefetch => {'cds' => 'tags'} }); my @artists = $rs1->all; @@ -19,9 +22,10 @@ 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; +# this is wrong, should accept me.title really +my $rs3 = $rs2->search_related('cds')->search({'cds.title' => 'Forkful of bees'}); + +cmp_ok($rs3->count, '==', 3, "Three artists returned"); my $rs4 = $schema->resultset("CD")->search({ 'artist.artistid' => '1' }, { join => ['tracks', 'artist'], prefetch => 'artist' }); my @rs4_results = $rs4->all;