Lines 99-105
subtest 'Test length of some generated fields' => sub {
Link Here
|
99 |
is( $item->{replacementprice}, sprintf("%.2f", $item->{replacementprice}), "The number of decimals for floats should not be more than 2" ); |
99 |
is( $item->{replacementprice}, sprintf("%.2f", $item->{replacementprice}), "The number of decimals for floats should not be more than 2" ); |
100 |
|
100 |
|
101 |
subtest '_gen_real formatting' => sub { |
101 |
subtest '_gen_real formatting' => sub { |
102 |
plan tests => 4; |
102 |
plan tests => 3; |
103 |
|
103 |
|
104 |
my $module = Test::MockModule->new('t::lib::TestBuilder'); |
104 |
my $module = Test::MockModule->new('t::lib::TestBuilder'); |
105 |
$module->mock(_gen_real => sub { |
105 |
$module->mock(_gen_real => sub { |
Lines 124-135
subtest 'Test length of some generated fields' => sub {
Link Here
|
124 |
is( $aqorder->{discount}, $aqorder_dbix->discount, |
124 |
is( $aqorder->{discount}, $aqorder_dbix->discount, |
125 |
"float - Builder builds same precision as DBIx returns." ); |
125 |
"float - Builder builds same precision as DBIx returns." ); |
126 |
|
126 |
|
127 |
my $statistic = $builder->build({ source => 'Statistic' }); |
127 |
##TODO: Remove this comment, and uncomment the following test when... |
128 |
$rs = $schema->source('Statistic')->resultset; |
128 |
##...statistics table gets a primary key. Related to Bug 27630. |
129 |
my $statistic_dbix = $rs->search({ |
129 |
#my $statistic = $builder->build({ source => 'Statistic' }); |
130 |
datetime => $statistic->{datetime} })->next; |
130 |
#$rs = $schema->source('Statistic')->resultset; |
131 |
is( $statistic->{value}, $statistic_dbix->value, |
131 |
#my $statistic_dbix = $rs->search({ |
132 |
"double - Builder builds same precision as DBIx returns." ); |
132 |
# datetime => $statistic->{datetime} })->next; |
|
|
133 |
#is( $statistic->{value}, $statistic_dbix->value, |
134 |
# "double - Builder builds same precision as DBIx returns." ); |
133 |
|
135 |
|
134 |
$module->unmock('_gen_real'); |
136 |
$module->unmock('_gen_real'); |
135 |
$builder = t::lib::TestBuilder->new; |
137 |
$builder = t::lib::TestBuilder->new; |