Commit | Line | Data |
0567538f |
1 | sub run_tests { |
1edaf6fe |
2 | my $schema = shift; |
0567538f |
3 | |
4 | BEGIN { |
5 | eval "use DBD::SQLite"; |
6 | plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 3); |
7 | } |
8 | |
f9db5527 |
9 | my $art = $schema->resultset("Artist")->find(1); |
0567538f |
10 | |
11 | isa_ok $art => 'DBICTest::Artist'; |
12 | |
13 | my $name = 'Caterwauler McCrae'; |
14 | |
15 | ok($art->name($name) eq $name, 'update'); |
16 | |
17 | { |
18 | my @changed_keys = $art->is_changed; |
19 | is( scalar (@changed_keys), 0, 'field changed but same value' ); |
20 | } |
21 | |
22 | $art->discard_changes; |
23 | |
24 | } |
25 | |
26 | 1; |