Restore ability to handle underdefined root (t/prefetch/incomplete.t)
[dbsrgits/DBIx-Class.git] / t / ordered / cascade_delete.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6 use lib qw(t/lib);
7 use DBICTest;
8
9 my $schema = DBICTest->init_schema();
10
11 {
12   my $artist = $schema->resultset ('Artist')->search ({}, { rows => 1})->single; # braindead sqlite
13   my $cd = $schema->resultset ('CD')->create ({
14     artist => $artist,
15     title => 'Get in order',
16     year => 2009,
17     tracks => [
18       { title => 'T1' },
19       { title => 'T2' },
20       { title => 'T3' },
21     ],
22   });
23
24   lives_ok (sub { $cd->delete}, "Cascade delete on ordered has_many doesn't bomb");
25 }
26
27 done_testing;