De-golf _is_deterministic_value, add more tests for create() with $rs conds
[dbsrgits/DBIx-Class.git] / t / bind / bindtype_columns.t
index 0eab861..a6be997 100644 (file)
@@ -10,8 +10,6 @@ my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/}
 plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
   unless ($dsn && $dbuser);
 
-plan tests => 6;
-
 my $schema = DBICTest::Schema->connection($dsn, $dbuser, $dbpass, { AutoCommit => 1 });
 
 my $dbh = $schema->storage->dbh;
@@ -82,6 +80,15 @@ my $new;
       $schema->txn_rollback;
     });
   }
+
+  # create with blob from $rs
+  $new = $rs->create({});
+  is($new->bytea, $big_long_string, 'Object has bytea value from $rs');
+  $new->discard_changes;
+  is($new->bytea, $big_long_string, 'bytea value made it to db');
 }
 
-$dbh->do("DROP TABLE bindtype_test");
+done_testing;
+
+eval { $dbh->do("DROP TABLE bindtype_test") };
+