X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F46where_attribute.t;h=e17b5184f2b15410c07213245e0fe427687f15e0;hb=9c0df5f32b68e23c670c89ce6cdbff60b4bd0ed0;hp=764d7cc415cd331e02970a67415b47bc305aefb7;hpb=78060df8cb43cafd81304f386d7111510a4b8f9d;p=dbsrgits%2FDBIx-Class.git diff --git a/t/46where_attribute.t b/t/46where_attribute.t index 764d7cc..e17b518 100644 --- a/t/46where_attribute.t +++ b/t/46where_attribute.t @@ -7,7 +7,7 @@ use lib qw(t/lib); use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 14; +plan tests => 16; # select from a class with resultset_attributes my $resultset = $schema->resultset('BooksInLibrary'); @@ -25,6 +25,12 @@ if ($@) { print $@ } ok(!$@, 'find_or_create on resultset with attribute for non-existent entry did not throw'); ok(defined $see_spot, 'successfully did insert on resultset with attribute for non-existent entry'); +my $see_spot_rs = $owner->books->search({ title => "See Spot Run" }); +eval { $see_spot_rs->delete(); }; +if ($@) { print $@ } +ok(!$@, 'delete on resultset with attribute did not throw'); +is($see_spot_rs->count(), 0, 'delete on resultset with attributes succeeded'); + # many_to_many tests my $collection = $schema->resultset('Collection')->search({collectionid => 1}); my $pointy_objects = $collection->search_related('collection_object')->search_related('object', { type => "pointy"});