Merge 'reorganize_tests' into 'DBIx-Class-current'
[dbsrgits/DBIx-Class.git] / t / 69update.t
1 use strict;
2 use warnings;  
3
4 use Test::More;
5 use lib qw(t/lib);
6 use DBICTest;
7
8 my $schema = DBICTest::init_schema();
9
10 BEGIN {
11         eval "use DBD::SQLite";
12         plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 3);
13 }                                                                               
14
15 my $art = $schema->resultset("Artist")->find(1);
16
17 isa_ok $art => 'DBICTest::Artist';
18
19 my $name = 'Caterwauler McCrae';
20
21 ok($art->name($name) eq $name, 'update');
22
23
24   my @changed_keys = $art->is_changed;
25   is( scalar (@changed_keys), 0, 'field changed but same value' );
26 }                                                                               
27
28 $art->discard_changes;
29