Recognize more authorship based on the historic repo (if available)
[dbsrgits/DBIx-Class.git] / t / delete / m2m.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
e60dc79f 3use strict;
f54428ab 4use warnings;
e60dc79f 5
6use Test::More;
c0329273 7
e60dc79f 8use DBICTest;
9
10my $schema = DBICTest->init_schema();
11
e60dc79f 12my $cd = $schema->resultset("CD")->find(2);
13ok $cd->liner_notes;
65d35121 14
15ok scalar(keys %{$cd->{_relationship_data}}), "_relationship_data populated";
e60dc79f 16
17$cd->discard_changes;
18ok $cd->liner_notes, 'relationships still valid after discarding changes';
19
20ok $cd->liner_notes->delete;
21$cd->discard_changes;
f54428ab 22ok !$cd->liner_notes, 'discard_changes resets relationship';
23
24done_testing;