From e2b8bbc11dfd09487a5e6c96517a929fb2a7ee37 Mon Sep 17 00:00:00 2001 From: zby Date: Fri, 30 Jan 2009 16:51:43 +0000 Subject: [PATCH] code for resolving --- t/lib/RunTests.pm | 12 ++++++------ t/var/dvdzbr.db | Bin 30720 -> 30720 bytes 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/t/lib/RunTests.pm b/t/lib/RunTests.pm index 2971bde..d0fce65 100644 --- a/t/lib/RunTests.pm +++ b/t/lib/RunTests.pm @@ -14,12 +14,12 @@ sub run_tests{ my $owner = $user_rs->next; my $another_owner = $user_rs->next; my $initial_user_count = $user_rs->count; + my $initial_dvd_count = $dvd_rs->count; # creating new record linked to some old record my $updates; $updates = { - id => undef, name => 'Test name 2', viewings => [ { user_id => $owner->id } ], owner => { id => $owner->id }, @@ -27,16 +27,16 @@ sub run_tests{ my $new_dvd = $dvd_rs->recursive_update( $updates ); # my $new_dvd = $dvd_rs->create( $updates ); - + + ok ( $new_dvd->isa( 'DBSchema::Result::Dvd' ), 'Dvd created' ); + is ( $dvd_rs->count, $initial_dvd_count + 1, 'Dvd created' ); is ( $schema->resultset( 'User' )->count, $initial_user_count, "No new user created" ); is ( $new_dvd->name, 'Test name 2', 'Dvd name set' ); is ( $new_dvd->owner->id, $owner->id, 'Owner set' ); -# is ( $new_dvd->viewing->user_id, $owner->id, 'Viewing created' ); + is ( $new_dvd->viewings->count, 1, 'Viewing created' ); ; # creating new records - my $updates = { - id => undef, aaaa => undef, tags => [ '2', { id => '3' } ], name => 'Test name', @@ -56,6 +56,7 @@ sub run_tests{ my $dvd = $dvd_rs->recursive_update( $updates ); ; + is ( $dvd_rs->count, $initial_dvd_count + 2, 'Dvd created' ); is ( $schema->resultset( 'User' )->count, $initial_user_count + 1, "One new user created" ); is ( $dvd->name, 'Test name', 'Dvd name set' ); is_deeply ( [ map {$_->id} $dvd->tags ], [ '2', '3' ], 'Tags set' ); @@ -64,7 +65,6 @@ sub run_tests{ is ( $dvd->current_borrower->name, 'temp name', 'Related record created' ); is ( $dvd->liner_notes->notes, 'test note', 'might_have record created' ); ok ( $schema->resultset( 'Twokeys' )->find( { dvd_name => 'Test name', key2 => 1 } ), 'Twokeys created' ); - # changing existing records my $num_of_users = $user_rs->count; diff --git a/t/var/dvdzbr.db b/t/var/dvdzbr.db index bd53857e33867ad8c6daf7167d052a7d77f57d9d..9c7241ca1a915c6f54cdbfe6a28551d8fdc7606a 100644 GIT binary patch delta 700 zcmY*Wy-!p@5Z{@3Z})NF9dICDiCiRn1O*}zOTk$9ap54rNFoi2#2`X2$EhGF+EADf z&1hq(g%t(tKL8dMR=d#<3ZcLlFeX4jWg@um8HsK&znzcY?EGeDc41~0o>vx+y%ztS zGs_DnKTzCC7cH=1DrP1YJ@86tNhoR)^oick9ObB=E>qjWlVgM>ic|TejWQ550vuy} zaAYhsdVORtb;?irfv6VX!dC{f<53hn&gG{YTw(H365zDx9vT=O8W>LHPJn9>g$|2T zt$Hi}8y!{TD*{mHO9v8tKLq_Xu|XAz0_8!NR1r#)e^9R{O9SxrUR8M>nk>g_*U^mg zcI_CN9QW6y(cI(tx(u58{HtzKng_D1y@Gc#<@~C?5Y2>sSAWe%Gs)D{hvp&oH_f7% z;_ppUXr}pA^Dvr6{JD7q&0{{_GAFH&W#_8G270HZun=IeW1q?aVot20RY7aCN_(_T zTlAAQbdmR-&Uz$3g+_*wyhxY>cL$0rhL#{kYpw?iS|&{!v`Zi9EwSq{O`J<7id2GX z;Gfk?*6GIM?qR?C2vx)3M*Xnv&~y7eNVfx8;Ev9_Xpwd2JX+!#nOU?R|H!nW_4!3t zCEw|a^M$U9Xr*(r#fnyhQ?ch}3H5xT6*tQgvFY&(R5-F92|~Tu^Ayo49=`fa+Tibk txTLojZ5}uD-bNeKFMB(@qzXcwir6w@OTF1w7P#MDyt$tM&<9!YegoPvv={&Y delta 794 zcmah{&r4KM6n^)dckjDtsX0^r0(~gz5UKd9(rO$te-6$>MFUBs>0mZFS~{C(p+U3= zq&WEx*rJ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