added tests for RT#63709
[dbsrgits/DBIx-Class.git] / t / row / copy_with_extra_selection.t
CommitLineData
cc506f8b 1use strict;
2use warnings;
3
4use Test::More;
5
6use lib qw(t/lib);
7use DBICTest;
8
9my $schema = DBICTest->init_schema();
10
11my $cd = $schema->resultset('CD')->search({}, {
12 '+columns' => { avg_year => $schema->resultset('CD')->get_column('year')->func_rs('avg')->as_query },
13 order_by => 'cdid',
14})->next;
15
16my $ccd = $cd->copy({ cdid => 5_000_000, artist => 2 });
17
18cmp_ok(
19 $ccd->id,
20 '!=',
21 $cd->id,
22 'IDs differ'
23);
24
25is(
26 $ccd->title,
27 $cd->title,
28 'Title same on copied object',
29);
30
31done_testing;