From: skaufman Date: Mon, 11 Aug 2014 18:45:31 +0000 (+0100) Subject: test for use_find_or_create X-Git-Tag: v1.001022_01~4^2~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e54ab7f32f6dc5789ff25b003af64295d6ece572;p=dbsrgits%2FDBIx-Class-Fixtures.git test for use_find_or_create --- diff --git a/t/12-populate-basic.t b/t/12-populate-basic.t index e37f490..35ff4d2 100644 --- a/t/12-populate-basic.t +++ b/t/12-populate-basic.t @@ -81,3 +81,21 @@ $fixtures->populate({ }); $schema = DBICTest->init_schema( no_deploy => 1, no_populate => 1 ); is( $schema->resultset( "Artist" )->find({ artistid => 4 })->name, "Test Name", "use_create => 1 ok" ); + +$schema = DBICTest->init_schema( no_populate => 1 ); +$fixtures->populate({ + directory => 't/var/fixtures', + connection_details => ['dbi:SQLite:t/var/DBIxClass.db', '', ''], + schema => $schema, + no_deploy => 1, + use_find_or_create => 1 +}); +is( $schema->resultset( "Artist" )->find({ artistid => 4 })->name, "Test Name", "use_find_or_create => 1 ok" ); +$fixtures->populate({ + directory => 't/var/fixtures', + connection_details => ['dbi:SQLite:t/var/DBIxClass.db', '', ''], + schema => $schema, + no_deploy => 1, + use_find_or_create => 1 +}); +is( $schema->resultset( "Artist" )->find({ artistid => 4 })->name, "Test Name", "idempotent use_find_or_create => 1 ok" );