X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F72pg.t;h=d676812c5d89888ab219da073ac44bb1c9fef7ab;hb=f8583f8f51fd7ac8eeb348ad390219152a8a3bf8;hp=542b915080a61907a3d4557eccc159b82a28e2c8;hpb=0647e0cc4a0845da7df3775b1b56bd2b6f9efeb2;p=dbsrgits%2FDBIx-Class.git diff --git a/t/72pg.t b/t/72pg.t index 542b915..d676812 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -201,6 +201,15 @@ for my $use_insert_returning ($test_server_supports_insert_returning is( $uc_name_info->{size}, 3, "Case insensitive matching info for 'uc_name'" ); +## Test ResultSet->update +my $artist = $schema->resultset('Artist')->first; +my $cds = $artist->cds_unordered->search({ + year => { '!=' => 2010 } +}, { prefetch => 'liner_notes' }); +TODO: { + todo_skip 'update resultset with a prefetch over a might_have rel', 1; + $cds->update({ year => '2010' }); +} ## Test SELECT ... FOR UPDATE @@ -238,12 +247,15 @@ for my $use_insert_returning ($test_server_supports_insert_returning $schema2->source("Artist")->name("dbic_t_schema.artist"); $schema->txn_do( sub { - my $artist = $schema->resultset('Artist')->search( + my $rs = $schema->resultset('Artist')->search( { artistid => 1 }, $t->{update_lock} ? { for => 'update' } : {} - )->first; + ); + ok ($rs->count, 'Count works'); + + my $artist = $rs->next; is($artist->artistid, 1, "select returns artistid = 1"); $timed_out = 0;