Ordered test
Peter Rabbitson [Fri, 20 Feb 2009 14:33:24 +0000 (14:33 +0000)]
t/ordered/87ordered.t [new file with mode: 0644]

diff --git a/t/ordered/87ordered.t b/t/ordered/87ordered.t
new file mode 100644 (file)
index 0000000..8a95420
--- /dev/null
@@ -0,0 +1,33 @@
+use strict;
+use warnings;  
+
+use Test::More;
+use Test::Exception;
+use lib qw(t/lib);
+use DBICTest;
+
+use POSIX qw(ceil);
+
+my $schema = DBICTest->init_schema();
+
+plan tests => 1;
+
+{
+  my $artist = $schema->resultset ('Artist')->search ({}, { rows => 1})->single, # braindead sqlite
+
+  $schema->storage->debug (1);
+  my $cd = $schema->resultset ('CD')->create ({
+    artist => $artist,
+    title => 'Get in order',
+    year => 2009,
+    tracks => [
+      { title => 'T1' },
+      { title => 'T2' },
+      { title => 'T3' },
+    ],
+  });
+
+  lives_ok (sub { $cd->delete}, "Cascade delete on ordered has_many doesn't bomb");
+}
+
+1;