[Bast-commits] r5387 - in
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t: lib var
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Fri Jan 30 16:51:43 GMT 2009
Author: zby
Date: 2009-01-30 16:51:43 +0000 (Fri, 30 Jan 2009)
New Revision: 5387
Modified:
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/lib/RunTests.pm
DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/var/dvdzbr.db
Log:
code for resolving
Modified: DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/lib/RunTests.pm
===================================================================
--- DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/lib/RunTests.pm 2009-01-30 16:18:33 UTC (rev 5386)
+++ DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/lib/RunTests.pm 2009-01-30 16:51:43 UTC (rev 5387)
@@ -14,12 +14,12 @@
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 @@
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 @@
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 @@
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;
Modified: DBIx-Class-ResultSet-RecursiveUpdate/1.000/trunk/t/var/dvdzbr.db
===================================================================
(Binary files differ)
More information about the Bast-commits
mailing list