Refactor ::DBIHacks::_extract_fixed_condition_columns (sequel to 8d005ad9)
[dbsrgits/DBIx-Class.git] / t / 70auto.t
CommitLineData
70350518 1use strict;
8273e845 2use warnings;
70350518 3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7
a47e1233 8my $schema = DBICTest->init_schema();
0567538f 9
2f6e5af9 10plan tests => 2;
0567538f 11
0a8462d4 12$schema->class("Artist")->load_components(qw/PK::Auto::SQLite/);
13 # Should just be PK::Auto but this ensures the compat shim works
0567538f 14
15# add an artist without primary key to test Auto
f9db5527 16my $artist = $schema->resultset("Artist")->create( { name => 'Auto' } );
0567538f 17$artist->name( 'Auto Change' );
18ok($artist->update, 'update on object created without PK ok');
19
2f6e5af9 20my $copied = $artist->copy({ name => 'Don\'t tell the RIAA', artistid => undef });
21is($copied->name, 'Don\'t tell the RIAA', "Copied with PKs ok.");
22