From: Guillermo Roditi Date: Sun, 22 Mar 2009 01:10:30 +0000 (+0000) Subject: adding test for exception if nullable rel call is not explicitly defined as undef... X-Git-Tag: v0.08100~27 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c49fcf72;p=dbsrgits%2FDBIx-Class.git adding test for exception if nullable rel call is not explicitly defined as undef on insert --- diff --git a/Changes b/Changes index 96f8cde..9aa7264 100644 --- a/Changes +++ b/Changes @@ -23,6 +23,8 @@ Revision history for DBIx::Class in the wrong order. - columns/+columns attributes now support { as => select } hahsrefs - support for views both in DBIC and via deploy() in SQLT + - test for not dying if a column isn't loaded after insert and a rel using + it is called. (eg ->new({ name => 'foo'})->bar if bar uses bar_id) 0.08099_06 2009-01-23 07:30:00 (UTC) - Allow a scalarref to be supplied to the 'from' resultset attribute diff --git a/t/66relationship.t b/t/66relationship.t index 798e660..a6fc404 100644 --- a/t/66relationship.t +++ b/t/66relationship.t @@ -8,7 +8,7 @@ use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 70; +plan tests => 71; # has_a test my $cd = $schema->resultset("CD")->find(4); @@ -35,10 +35,11 @@ is( $cds[1]->title, 'Forkful of bees', 'search_related with abstract query ok' ) if ($INC{'DBICTest/HelperRels.pm'}) { $artist->add_to_cds({ title => 'Big Flop', year => 2005 }); } else { - $artist->create_related( 'cds', { + my $big_flop = $artist->create_related( 'cds', { title => 'Big Flop', year => 2005, } ); + lives_ok { $big_flop->genre} "Don't throw exception when col is not loaded after insert"; } my $big_flop_cd = ($artist->search_related('cds'))[3];