9 my $schema = DBICTest->init_schema();
11 my $cd = $schema->resultset('CD')->next;
14 $schema->resultset('CD')->related_resultset('tracks')->delete;
16 is $cd->tracks->count, 0, 'No tracks';
18 $cd->create_related('tracks', { title => "t_$_", position => $_ })
21 is $cd->tracks->count, 5, 'Created 5 tracks';
23 # a txn should force the implicit pos reload, regardless of order
25 $cd->tracks->delete_all
28 is $cd->tracks->count, 0, 'Successfully deleted everything';