X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fdelete%2Fm2m.t;fp=t%2Fdelete%2Fm2m.t;h=56137218815f22e7d6cbfc5775069a60aebabaca;hb=157fdb0cae2758f6f97dbe33c25f469fea0c777e;hp=0000000000000000000000000000000000000000;hpb=855c6fd0a7864a9453e07f103cfdfdd5054afebf;p=dbsrgits%2FDBIx-Class.git diff --git a/t/delete/m2m.t b/t/delete/m2m.t new file mode 100644 index 0000000..5613721 --- /dev/null +++ b/t/delete/m2m.t @@ -0,0 +1,23 @@ +#!/usr/bin/perl -w + +use strict; +use warnings; + +use Test::More; +use lib qw(t/lib); +use DBICTest; + +my $schema = DBICTest->init_schema(); + +plan tests => 5; + +my $cd = $schema->resultset("CD")->find(2); +ok $cd->liner_notes; +ok keys %{$cd->{_relationship_data}}, "_relationship_data populated"; + +$cd->discard_changes; +ok $cd->liner_notes, 'relationships still valid after discarding changes'; + +ok $cd->liner_notes->delete; +$cd->discard_changes; +ok !$cd->liner_notes, 'discard_changes resets relationship'; \ No newline at end of file