Fail early on literal-ordered complex prefetch without explicit group_by clause
[dbsrgits/DBIx-Class.git] / t / prefetch / with_limit.t
index bc035de..4acdcab 100644 (file)
@@ -84,6 +84,15 @@ throws_ok (
   'single() with multiprefetch is illegal',
 );
 
+throws_ok (
+  sub {
+    $use_prefetch->search(
+      {'tracks.title' => { '!=' => 'foo' }},
+      { order_by => \ 'some oddball literal sql', join => { cds => 'tracks' } }
+    )->next
+  }, qr/A required group_by clause could not be constructed automatically/,
+);
+
 my $artist = $use_prefetch->search({'cds.title' => $artist_many_cds->cds->first->title })->next;
 is($artist->cds->count, 1, "count on search limiting prefetched has_many");