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