X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=blobdiff_plain;f=t%2Flib%2FRunTests.pm;h=d0fce5b74b594cac099cd64bd7eca35c3517fdad;hp=defb70128de29976bb718a57ab4999d0328966dc;hb=a4ecdd8419319b934a186dae8830c20542deb151;hpb=26d2267b2b938a7b6ee683d1b8e6e500bbb893d1 diff --git a/t/lib/RunTests.pm b/t/lib/RunTests.pm index defb701..d0fce5b 100644 --- a/t/lib/RunTests.pm +++ b/t/lib/RunTests.pm @@ -9,7 +9,7 @@ use DBIx::Class::ResultSet::RecursiveUpdate; sub run_tests { my $schema = shift; - plan tests => 45; + plan tests => 47; my $dvd_rs = $schema->resultset('Dvd'); my $user_rs = $schema->resultset('User'); @@ -20,6 +20,15 @@ sub run_tests { my $initial_dvd_count = $dvd_rs->count; my $updates; + $dvd_rs->search( { dvd_id => 1 } )->recursive_update( { + owner => { username => 'aaa' } + }, + [ 'dvd_id' ] + ); + + my $u = $user_rs->find( $dvd_rs->find( 1 )->owner->id ); + is( $u->username, 'aaa', 'fixed_fields' ); + # try to create with a not existing rel $updates = { name => 'Test name for nonexisting rel', @@ -95,6 +104,10 @@ sub run_tests { ->find( { key1 => $onekey->id, key2 => 1 } ), 'Twokeys_belongsto created' ); + TODO: { + local $TODO = 'value of fk from a multi relationship'; + is( $dvd->twokeysfk, $onekey->id, 'twokeysfk in Dvd' ); + }; is( $dvd->name, 'Test name', 'Dvd name set' ); # changing existing records