Cleanup shebang lines of all maint/example scripts, remove from tests entirely
[dbsrgits/DBIx-Class.git] / t / delete / m2m.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use lib qw(t/lib);
6 use DBICTest;
7
8 my $schema = DBICTest->init_schema();
9
10 my $cd = $schema->resultset("CD")->find(2);
11 ok $cd->liner_notes;
12 ok keys %{$cd->{_relationship_data}}, "_relationship_data populated";
13
14 $cd->discard_changes;
15 ok $cd->liner_notes, 'relationships still valid after discarding changes';
16
17 ok $cd->liner_notes->delete;
18 $cd->discard_changes;
19 ok !$cd->liner_notes, 'discard_changes resets relationship';
20
21 done_testing;