From: Ian Wells <ijw@cack.org.uk>
Date: Wed, 1 Jul 2009 17:34:32 +0000 (+0000)
Subject: Added a test for a resultset to related-resultset join for 0 related records
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d3cceebf4d6b3a7b80f770574498afad1d6988df;p=dbsrgits%2FDBIx-Class-Historic.git

Added a test for a resultset to related-resultset join for 0 related records
---

diff --git a/t/count/joined.t b/t/count/joined.t
index 5ba7deb..3f0b514 100644
--- a/t/count/joined.t
+++ b/t/count/joined.t
@@ -7,7 +7,7 @@ use lib qw(t/lib);
 
 use DBICTest;
 
-plan tests => 3;
+plan tests => 5;
 
 my $schema = DBICTest->init_schema();
 
@@ -26,6 +26,10 @@ is (
   "Count correct with requested distinct collapse of main table"
 );
 
-
-
+my $artist=$schema->resultset('Artist')->create({name => 'xxx'});
+is($artist->related_resultset('cds')->count(), 0,
+   "No CDs found for a shiny new artist");
+my $artist_rs = $schema->resultset('Artist')->search({artistid => $artist->id});
+is($artist_rs->related_resultset('cds')->count(), 0,
+   "No CDs found for a shiny new artist using a resultset search");