X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fupdate%2Fall.t;fp=t%2Fupdate%2Fall.t;h=acc83878e802fbfcf9e01c80c25fdeb6c064d636;hb=8d2da21aebb41c0f460c6124e4a128473a18fad6;hp=0000000000000000000000000000000000000000;hpb=867f1b28c4934e62ad3545c8607b2bf4c145b34a;p=dbsrgits%2FDBIx-Class.git diff --git a/t/update/all.t b/t/update/all.t new file mode 100644 index 0000000..acc8387 --- /dev/null +++ b/t/update/all.t @@ -0,0 +1,21 @@ +use strict; +use warnings; + +use Test::More; +use lib qw(t/lib); +use DBICTest; + +my $schema = DBICTest->init_schema(); + +my $new_artist = $schema->resultset('Artist')->create({ name => 'new kid behind the block' }); + +# see how many cds do we have, and relink them all to the new guy +my $cds = $schema->resultset('CD'); +my $cds_count = $cds->count; +cmp_ok($cds_count, '>', 0, 'have some cds'); + +$cds->update_all({ artist => $new_artist }); + +is( $new_artist->cds->count, $cds_count, 'All cds properly relinked'); + +done_testing;