Fixed caveats
[dbsrgits/DBIx-Class-Historic.git] / t / 746mssql.t
index 09f065f..fa8f137 100644 (file)
@@ -12,7 +12,7 @@ my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ODBC_${_}" } qw/DSN USER PA
 plan skip_all => 'Set $ENV{DBICTEST_MSSQL_ODBC_DSN}, _USER and _PASS to run this test'
   unless ($dsn && $user);
 
-plan tests => 31;
+plan tests => 33;
 
 my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
 
@@ -83,7 +83,7 @@ $schema->storage->dbh_do (sub {
 
 CREATE TABLE money_test (
    id INT IDENTITY PRIMARY KEY,
-   amount money
+   amount MONEY NULL
 )
 
 SQL
@@ -105,6 +105,12 @@ lives_ok {
 
 is $rs->find($row->id)->amount, '200.00', 'updated money value round-trip';
 
+lives_ok {
+  $row->update({ amount => undef });
+} 'updated a money value to NULL';
+
+is $rs->find($row->id)->amount, undef,'updated money value to NULL round-trip';
+
 $schema->storage->dbh_do (sub {
     my ($storage, $dbh) = @_;
     eval { $dbh->do("DROP TABLE Owners") };