X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=blobdiff_plain;f=t%2Flib%2FRunTests.pm;h=1f31adacc9a5357728e399b8b4476ebe31230c40;hp=e8c601d1473bc1ff5e24e3fe2edb9a7b9dc513ae;hb=073ab86177b3de3f95b1d2a0dc97f3e8e582c7a6;hpb=5460c3fd3d2063eb55dd8a72bf3335952f1950b7 diff --git a/t/lib/RunTests.pm b/t/lib/RunTests.pm index e8c601d..1f31ada 100644 --- a/t/lib/RunTests.pm +++ b/t/lib/RunTests.pm @@ -9,7 +9,7 @@ use Test::More; sub run_tests{ my $schema = shift; - plan tests => 27; + plan tests => 28; my $dvd_rs = $schema->resultset( 'Dvd' ); my $user_rs = $schema->resultset( 'User' ); @@ -79,7 +79,7 @@ sub run_tests{ # changing existing records - + my $num_of_users = $user_rs->count; $updates = { id => $dvd->id, @@ -106,7 +106,12 @@ sub run_tests{ is ( $dvd->tags->count, 0, 'Tags deleted' ); is ( $dvd->liner_notes->notes, 'test note changed', 'might_have record changed' ); - + $updates = { + name => 'Test name 1', + }; + $dvd = $dvd_rs->search( { id => $dvd->id } )->recursive_update( $updates, [ 'id' ] ); + is ( $dvd->name, 'Test name 1', 'Dvd name set in a resultset with restricted id' ); + # repeatable $updates = {