[Bast-commits] r5608 - DBIx-Class/0.08/trunk/t
ribasushi at dev.catalyst.perl.org
ribasushi at dev.catalyst.perl.org
Fri Feb 20 18:27:40 GMT 2009
Author: ribasushi
Date: 2009-02-20 18:27:39 +0000 (Fri, 20 Feb 2009)
New Revision: 5608
Modified:
DBIx-Class/0.08/trunk/t/96multi_create_torture.t
Log:
Now even the torture corner case works
Modified: DBIx-Class/0.08/trunk/t/96multi_create_torture.t
===================================================================
--- DBIx-Class/0.08/trunk/t/96multi_create_torture.t 2009-02-20 18:12:38 UTC (rev 5607)
+++ DBIx-Class/0.08/trunk/t/96multi_create_torture.t 2009-02-20 18:27:39 UTC (rev 5608)
@@ -6,7 +6,7 @@
use lib qw(t/lib);
use DBICTest;
-plan tests => 19;
+plan tests => 23;
# an insane multicreate
# (should work, despite the fact that no one will probably use it this way)
@@ -54,13 +54,7 @@
],
# This cd is created via artist so it doesn't know about producers
cd_to_producer => [
- # if we specify 'bob' here things bomb
- # as the producer attached to Greatest Hits 1 is
- # already created, but not yet inserted.
- # Maybe this can be fixed, but things are hairy
- # enough already.
- #
- #{ producer => { name => 'bob' } },
+ { producer => { name => 'bob' } },
{ producer => { name => 'paul' } },
{ producer => {
name => 'flemming',
@@ -161,7 +155,7 @@
);
is ($paul_prod->count, 1, 'Paul had 1 production');
my $pauls_cd = $paul_prod->single;
- is ($pauls_cd->cd_to_producer->count, 2, 'Paul had one co-producer');
+ is ($pauls_cd->cd_to_producer->count, 3, 'Paul had two co-producers');
is (
$pauls_cd->search_related ('cd_to_producer',
{ 'producer.name' => 'flemming'},
@@ -205,15 +199,19 @@
{ 'producer.name' => 'bob'},
{ join => 'producer' }
)->count,
- 2,
- 'Lars produced 2 CDs with bob',
+ 3,
+ 'Lars produced 3 CDs with bob',
);
my $bob_prod = $cd_rs->search (
{ 'producer.name' => 'bob'},
{ join => { cd_to_producer => 'producer' } }
);
- is ($bob_prod->count, 3, 'Bob produced a total of 3 CDs');
+ is ($bob_prod->count, 4, 'Bob produced a total of 4 CDs');
+ ok ($bob_prod->find ({ title => 'Greatest hits 1'}), '1st Bob production name correct');
+ ok ($bob_prod->find ({ title => 'Greatest hits 6'}), '2nd Bob production name correct');
+ ok ($bob_prod->find ({ title => 'Greatest hits 2'}), '3rd Bob production name correct');
+ ok ($bob_prod->find ({ title => 'Greatest hits 7'}), '4th Bob production name correct');
is (
$bob_prod->search ({ 'artist.name' => 'james' }, { join => 'artist' })->count,
More information about the Bast-commits
mailing list