1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
11 my $schema = DBICTest->init_schema();
13 my $cd = $schema->resultset('CD')->next;
16 $schema->resultset('CD')->related_resultset('tracks')->delete;
18 is $cd->tracks->count, 0, 'No tracks';
20 $cd->create_related('tracks', { title => "t_$_", position => $_ })
23 is $cd->tracks->count, 5, 'Created 5 tracks';
25 # a txn should force the implicit pos reload, regardless of order
27 $cd->tracks->delete_all
30 is $cd->tracks->count, 0, 'Successfully deleted everything';