X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=blobdiff_plain;f=t%2Flib%2FRunTests.pm;h=fd4fe71d9cf655003c477a1c0767fc6696952247;hp=4557e016975f31c21552dd7941ff862687bf14dd;hb=f6641f7ade5a9b4227feef8a538228fcea80a5b2;hpb=6239425671e0ed46863cf0e669740abf3cf26fec diff --git a/t/lib/RunTests.pm b/t/lib/RunTests.pm index 4557e01..fd4fe71 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 => 28; + plan tests => 29; my $dvd_rs = $schema->resultset( 'Dvd' ); my $user_rs = $schema->resultset( 'User' ); @@ -133,6 +133,20 @@ sub run_tests{ is( scalar @tags, 2, 'Tags in has_many related record saved' ); ok( $owned_dvds{'temp name 2'}, 'Second name in a has_many related record saved' ); + $updates = { + id => $user->id, + address => { + street => "101 Main Street", + city => "Podunk", + state => "New York" + } + }; + $user = $user_rs->recursive_update( $updates ); + $user = $user_rs->recursive_update( $updates ); + is( $schema->resultset( 'Address' )->search({ user_id => $user->id })->count, 1, + 'the right number of addresses' ); + + # $updates = { # name => 'Test name 1', # };