more has_relationship_loaded tests + fix for the failing tests
[dbsrgits/DBIx-Class.git] / t / 69update.t
index b11ebde..ea1eaae 100644 (file)
@@ -1,5 +1,5 @@
 use strict;
-use warnings;  
+use warnings;
 
 use Test::More;
 use lib qw(t/lib);
@@ -7,11 +7,6 @@ use DBICTest;
 
 my $schema = DBICTest->init_schema();
 
-BEGIN {
-        eval "use DBD::SQLite";
-        plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 5);
-}                                                                               
-
 my $art = $schema->resultset("Artist")->find(1);
 
 isa_ok $art => 'DBICTest::Artist';
@@ -20,13 +15,19 @@ my $name = 'Caterwauler McCrae';
 
 ok($art->name($name) eq $name, 'update');
 
-{ 
+{
   my @changed_keys = $art->is_changed;
   is( scalar (@changed_keys), 0, 'field changed but same value' );
-}                                                                               
+}
 
 $art->discard_changes;
 
 ok($art->update({ artistid => 100 }), 'update allows pk mutation');
 
 is($art->artistid, 100, 'pk mutation applied');
+
+my $art_100 = $schema->resultset("Artist")->find(100);
+$art_100->artistid(101);
+ok($art_100->update(), 'update allows pk mutation via column accessor');
+
+done_testing;