my $schema = DBICTest->init_schema();
-plan tests => 24;
+plan tests => 23;
my $rs = $schema->resultset('CD')->search({},
{
cmp_ok ($cds->count, '>', 2, 'Initially populated with more than 2 CDs');
my $table = $cds->result_source->name;
-
-$DB::single = 1;
-
+$table = $$table if ref $table eq 'SCALAR';
my $subsel = $cds->search ({}, {
columns => [qw/cdid title/],
from => \ "(SELECT cdid, title FROM $table LIMIT 2) me",
}
);
-is_deeply (
- $sub_rs->single,
- {
- artist => 1,
- track_position => 2,
- tracks =>
- {
- trackid => 17,
- title => 'Apiary',
- },
- },
- 'columns/select/as fold properly on sub-searches',
-);
-
-TODO: {
- local $TODO = "Multi-collapsing still doesn't work right - HRI should be getting an arrayref, not an individual hash";
- is_deeply (
+is_deeply(
$sub_rs->single,
{
- artist => 1,
- track_position => 2,
- tracks => [
- {
- trackid => 17,
- title => 'Apiary',
- },
- ],
+ artist => 1,
+ track_position => 2,
+ tracks => [
+ {
+ trackid => 17,
+ title => 'Apiary',
+ },
+ ],
},
'columns/select/as fold properly on sub-searches',
- );
-}
+);
+
+