X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Frelationship%2Fcore.t;h=566e5f32d8a4d818c92b930996172d41d3316a9e;hb=aee988d2051f998d1a0d2a2621ee49f49ce87aa1;hp=26ecf9b3d47c7ddd6e361be1ce6e82b1262824b0;hpb=a2287768f5c3dd665c469d7f9dfe99d369ff6781;p=dbsrgits%2FDBIx-Class.git diff --git a/t/relationship/core.t b/t/relationship/core.t index 26ecf9b..566e5f3 100644 --- a/t/relationship/core.t +++ b/t/relationship/core.t @@ -9,7 +9,7 @@ use DBICTest; my $schema = DBICTest->init_schema(); my $sdebug = $schema->storage->debug; -plan tests => 78; +plan tests => 79; # has_a test my $cd = $schema->resultset("CD")->find(4); @@ -276,11 +276,11 @@ my $searched = $mapped_rs->search({'mapped_artists.artistid' => {'!=', undef}}); cmp_ok($searched->count, '==', 2, "Both artist returned from map after adding another condition"); -# check join through cascaded has_many relationships +# check join through cascaded has_many relationships (also empty has_many rels) $artist = $schema->resultset("Artist")->find(1); my $trackset = $artist->cds->search_related('tracks'); -# LEFT join means we also see the trackless additional album... -cmp_ok($trackset->count, '==', 11, "Correct number of tracks for artist"); +is($trackset->count, 10, "Correct number of tracks for artist"); +is($trackset->all, 10, "Correct number of track objects for artist"); # now see about updating eveything that belongs to artist 2 to artist 3 $artist = $schema->resultset("Artist")->find(2);