deprecated add_row_info and added replacement method build_metadata
[dbsrgits/DBIx-Class-ResultSet-WithMetaData.git] / t / custom_methods.t
index 7c8c64a..9db7886 100644 (file)
@@ -9,7 +9,7 @@ use Data::Dumper;
 ok(my $schema = DBICTest->init_schema(), 'got schema');
 
 {
-       my $artist_rs = $schema->resultset('Artist')->order_by(col => 'artistid')->display();
+       my $artist_rs = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->display();
        is_deeply($artist_rs, [
                {
                        'artistid' => '1',
@@ -27,7 +27,7 @@ ok(my $schema = DBICTest->init_schema(), 'got schema');
 }
 
 {
-       my $artists = $schema->resultset('Artist')->order_by(col => 'artistid')->with_substr->display();
+       my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr->display();
        is_deeply($artists, [
                {
                        'artistid' => '1',
@@ -47,8 +47,29 @@ ok(my $schema = DBICTest->init_schema(), 'got schema');
        ], 'display with substring okay');
 }
 
+# {
+#      my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr_old->display();
+#      is_deeply($artists, [
+#              {
+#                      'artistid' => '1',
+#                      'name' => 'Caterwauler McCrae',
+#                      'substr' => 'Cat'
+#              },
+#              {
+#                      'artistid' => '2',
+#                      'name' => 'Random Boy Band',
+#                      'substr' => 'Ran'
+#              },
+#              {
+#                      'artistid' => '3',
+#                      'name' => 'We Are Goth',
+#                      'substr' => 'We '
+#              }
+#      ], 'display with substring okay');
+# }
+
 {
-       my $artists = $schema->resultset('Artist')->order_by(col => 'artistid')->with_substr->search({}, { prefetch => 'cds', rows => 1 })->display();
+       my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr->search({}, { prefetch => 'cds', rows => 1 })->display();
        is_deeply($artists, [
       { 
         'artistid' => 1,