Fix for upcoming (not yet available via DBD::SQLite) libsqlite version
[dbsrgits/DBIx-Class.git] / t / prefetch / grouped.t
index 0f6f59a..c0d2224 100644 (file)
@@ -1,9 +1,10 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
 use strict;
 use warnings;
 
 use Test::More;
 
-use lib qw(t/lib);
 use DBICTest ':DiffSQL';
 use DBIx::Class::SQLMaker::LimitDialects;
 
@@ -100,7 +101,7 @@ my @cdids = sort $cd_rs->get_column ('cdid')->all;
 
   # add an extra track to one of the cds, and then make sure we can get it on top
   # (check if limit works)
-  my $top_cd = $cd_rs->slice (1,1)->next;
+  my $top_cd = $cd_rs->search({}, { order_by => 'cdid' })->slice (1,1)->next;
   $top_cd->create_related ('tracks', {
     title => 'over the top',
   });