8 # set up and populate schema
9 ok(my $schema = DBICTest->init_schema(), 'got schema');
12 my $artist_rs = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->display();
13 is_deeply($artist_rs, [
16 'name' => 'Caterwauler McCrae'
20 'name' => 'Random Boy Band'
24 'name' => 'We Are Goth'
26 ], 'ordered display returned as expected');
30 my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr->display();
34 'name' => 'Caterwauler McCrae',
39 'name' => 'Random Boy Band',
44 'name' => 'We Are Goth',
47 ], 'display with substring okay');
51 # my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr_old->display();
52 # is_deeply($artists, [
55 # 'name' => 'Caterwauler McCrae',
60 # 'name' => 'Random Boy Band',
65 # 'name' => 'We Are Goth',
68 # ], 'display with substring okay');
72 my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr->search({}, { prefetch => 'cds', rows => 1 })->display();
80 'title' => 'Caterwaulin\' Blues',
86 'title' => 'Spoonful of bees',
92 'title' => 'Forkful of bees',
96 'name' => 'Caterwauler McCrae',
99 ], 'substring before prefetch okay');