Merge 'trunk' into 'replication_dedux'
[dbsrgits/DBIx-Class.git] / t / 46where_attribute.t
index 764d7cc..e17b518 100644 (file)
@@ -7,7 +7,7 @@ use lib qw(t/lib);
 use DBICTest;\r
 my $schema = DBICTest->init_schema();\r
 \r
-plan tests => 14;\r
+plan tests => 16;\r
 \r
 # select from a class with resultset_attributes\r
 my $resultset = $schema->resultset('BooksInLibrary');\r
@@ -25,6 +25,12 @@ if ($@) { print $@ }
 ok(!$@, 'find_or_create on resultset with attribute for non-existent entry did not throw');\r
 ok(defined $see_spot, 'successfully did insert on resultset with attribute for non-existent entry');\r
 \r
+my $see_spot_rs = $owner->books->search({ title => "See Spot Run" });\r
+eval { $see_spot_rs->delete(); };\r
+if ($@) { print $@ }\r
+ok(!$@, 'delete on resultset with attribute did not throw');\r
+is($see_spot_rs->count(), 0, 'delete on resultset with attributes succeeded');\r
+\r
 # many_to_many tests\r
 my $collection = $schema->resultset('Collection')->search({collectionid => 1});\r
 my $pointy_objects = $collection->search_related('collection_object')->search_related('object', { type => "pointy"});\r