X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-DBIx-Class-ResultSet-RecursiveUpdate;a=blobdiff_plain;f=t%2F96multi_create.t;h=6ef75d620a1163e8af037f0fd6322b2f0046236a;hp=d1e44b396921c48b5ec69049d4c5c6df31ecb15f;hb=8cc7f86b76634bbae9ec36aca0cb2669ebe78a18;hpb=75f3ba678630b75516689f3229db48f99f876604 diff --git a/t/96multi_create.t b/t/96multi_create.t index d1e44b3..6ef75d6 100644 --- a/t/96multi_create.t +++ b/t/96multi_create.t @@ -6,7 +6,7 @@ use Test::Exception; use lib qw(t/lib); use DBICTest; -plan tests => 95; +plan tests => 98; my $schema = DBICTest->init_schema(); @@ -738,4 +738,28 @@ eval { }; diag $@ if $@; + +## Test for the might_have is allowed empty bug (should check and see if this +## needs patching upstream to DBIC + +use DBIx::Class::ResultSet::RecursiveUpdate; + +my $might_have = { + artwork => undef, + liner_notes => undef, + tracks => [{title=>'hello', pos=>'100'}], + single_track_row => undef, +}; + +ok my $might_have_cd_rs = $schema->resultset('CD'), 'got a good resultset'; +ok my $might_have_cd_row = $might_have_cd_rs->first, 'got cd to test'; + +DBIx::Class::ResultSet::RecursiveUpdate::Functions::recursive_update( + resultset => $might_have_cd_rs, + updates => $might_have, + object => $might_have_cd_row, +); + +ok $schema->resultset('Track')->recursive_update($might_have), 'handled might_have'; + 1;