X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F03insert.t;h=e2a95fe1e80f153d9ec0ee8db7a6b5a95100e0fe;hb=712986b58368798f823738fb61e6331c50548405;hp=b82ecbc3c5703510676d2cd5d62f962eb925bef5;hpb=32098147b1ca9f76579541b0dd5e5df03e637162;p=dbsrgits%2FDBIx-Class-ResultSource-MultipleTableInheritance.git diff --git a/t/03insert.t b/t/03insert.t index b82ecbc..e2a95fe 100644 --- a/t/03insert.t +++ b/t/03insert.t @@ -3,12 +3,12 @@ use warnings; use lib 't/lib'; use Test::More qw(no_plan); use Test::Exception; -use Devel::Dwarn; +use CafeInsertion; BEGIN { - use_ok 'Cafe'; $ENV{DBIC_TRACE} = 0; } + my ( $dsn, $user, $pass ) = @ENV{ map {"DBICTEST_PG_${_}"} qw/DSN USER PASS/ }; plan skip_all => <<'EOM' unless $dsn && $user; @@ -16,10 +16,10 @@ Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test ( NOTE: This test drops and creates some tables.') EOM -my $schema = Cafe->connect( $dsn, $user, $pass ); -$schema->storage->dbh->{Warn} = 0; +my $schema = CafeInsertion->connect( $dsn, $user, $pass ); $schema->storage->ensure_connected; $schema->storage->_use_insert_returning(0); +$schema->storage->dbh->{Warn} = 0; my $dir = "t/sql"; # tempdir(CLEANUP => 0); $schema->create_ddl_dir( ['PostgreSQL'], 0.1, $dir ); @@ -34,8 +34,13 @@ isa_ok( my ( $drink, $drink1 ); lives_ok { - $drink = $schema->resultset('Sumatra') - ->create( { sweetness => 4, aroma => 'earthy', flavor => 'great' } ); + $drink = $schema->resultset('Sumatra')->create( + { sweetness => 4, + fat_free => 1, + aroma => 'earthy', + flavor => 'great' + } + ); } "I can call a create on a view sumatra"; @@ -44,3 +49,14 @@ lives_ok { } "I can do it for the other view, too"; +my $sqlt_object = $schema->{sqlt}; +is_deeply( + [ map { $_->name } $sqlt_object->get_views ], + [ qw/ + coffee + sumatra + / + ], + "SQLT view order triumphantly matches our order." +); +