1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
12 my $schema = DBICTest->init_schema( no_populate => 1 );
14 $schema->resultset('CD')->create({
15 cdid => 0, title => '', year => 0, genreid => 0, single_track => 0, artist => {
16 artistid => 0, name => '', rank => 0, charfield => 0,
20 $schema->is_executed_querycount( sub {
21 my $cd = $schema->resultset('CD')->search( {}, { prefetch => 'artist' })->next;
25 { artist => 0, cdid => 0, genreid => 0, single_track => 0, title => '', year => 0 },
26 'Expected CD columns present',
30 { $cd->artist->get_columns },
31 { artistid => 0, charfield => 0, name => "", rank => 0 },
32 'Expected Artist columns present',
34 }, 1, 'Only one query fired - prefetch worked' );