Add test for update with literal bind for inflating column
Dmitry Latin [Wed, 9 Apr 2014 16:52:55 +0000 (20:52 +0400)]
t/update/inflate_literal_bind.t [new file with mode: 0644]

diff --git a/t/update/inflate_literal_bind.t b/t/update/inflate_literal_bind.t
new file mode 100644 (file)
index 0000000..38527e3
--- /dev/null
@@ -0,0 +1,34 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Warn;
+use Try::Tiny;
+use lib qw(t/lib);
+use DBICTest;
+
+my $schema = DBICTest->init_schema();
+
+my $event = $schema->resultset("Event")->find(1);
+
+ok(
+    $event->update(
+        {
+            starts_at => \[
+                'MAX(datetime(?), datetime(?))', '2006-04-25T22:24:33',
+                '2007-04-25T22:24:33',
+            ]
+        }
+    ),
+    'update without error'
+);
+
+$event = $event->get_from_storage();
+
+is(
+    $event->starts_at . '',
+    '2007-04-25T22:24:33',
+    'starts_at updated properly'
+);
+
+done_testing;