Questionable test changes - need a review
[dbsrgits/DBIx-Class.git] / t / 90join_torture.t
index a277475..494237f 100644 (file)
@@ -45,10 +45,24 @@ my @cds = $artists2[0]->cds;
 cmp_ok(scalar @cds, '==', 1, "condition based on inherited join okay");
 
 my $rs3 = $rs2->search_related('cds');
-cmp_ok(scalar($rs3->all), '==', 45, "All cds for artist returned");
 
+# $rs3 selects * from cds_2, with the following join map
+#
+# artist -> cds_2
+#   |
+#   V
+#  cds -> cd_to_producer -> producer
+#   |
+#   |\--> tags
+#   V
+# tracks
+#
+# For some reason it is expected to return an exploded set of rows instead of the
+# logical 3, even for a rowobject retrieval - why?
+#
+cmp_ok(scalar($rs3->all), '==', 45, "All cds for artist returned");
 
-cmp_ok($rs3->count, '==', 45, "All cds for artist returned via count");
+cmp_ok($rs3->count, '==', 3, "All cds for artist returned via count");
 
 my $rs4 = $schema->resultset("CD")->search({ 'artist.artistid' => '1' }, { join => ['tracks', 'artist'], prefetch => 'artist' });
 my @rs4_results = $rs4->all;