]> Dogcows Code - chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate/blobdiff - t/lib/RunTests.pm
might_have with non pk fk
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / t / lib / RunTests.pm
index 4557e016975f31c21552dd7941ff862687bf14dd..fd4fe71d9cf655003c477a1c0767fc6696952247 100644 (file)
@@ -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',
 #    };
This page took 0.021318 seconds and 4 git commands to generate.