Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
2 | |
f9ae809a |
3 | use strict; |
8273e845 |
4 | use warnings; |
f9ae809a |
5 | |
6 | use Test::More; |
c0329273 |
7 | |
f9ae809a |
8 | use DBICTest; |
9 | |
10 | my $schema = DBICTest->init_schema(); |
11 | |
12 | plan tests => 4; |
13 | |
14 | my $artist = $schema->resultset ('Artist')->first; |
15 | ok (!$artist->get_dirty_columns, 'Artist is clean' ); |
16 | |
17 | $artist->rank (13); |
18 | ok (!$artist->get_dirty_columns, 'Artist is clean after num value update' ); |
19 | $artist->discard_changes; |
20 | |
21 | $artist->rank ('13.00'); |
22 | ok (!$artist->get_dirty_columns, 'Artist is clean after string value update' ); |
23 | $artist->discard_changes; |
24 | |
25 | # override column info |
26 | $artist->result_source->column_info ('rank')->{is_numeric} = 0; |
27 | $artist->rank ('13.00'); |
28 | ok ($artist->get_dirty_columns, 'Artist is updated after is_numeric override' ); |
29 | $artist->discard_changes; |