X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F10_09firebird_common.t;h=50b74be6c81427ef608b519254b42f59861b1234;hb=refs%2Fheads%2Fnamespace-cleanup;hp=47fff426f845d091589e115f7cfa8e23708fdd42;hpb=f7c4e9aebeb9279e7540638c1a367d8c186582c2;p=dbsrgits%2FDBIx-Class-Schema-Loader.git diff --git a/t/10_09firebird_common.t b/t/10_09firebird_common.t index 47fff42..50b74be 100644 --- a/t/10_09firebird_common.t +++ b/t/10_09firebird_common.t @@ -120,7 +120,7 @@ my $tester = dbixcsl_common_tests->new( => { data_type => 'blob sub_type text character set unicode_fss' }, }, extra => { - count => 9, + count => 11, create => [ q{ CREATE TABLE "Firebird_Loader_Test1" ( @@ -140,8 +140,12 @@ my $tester = dbixcsl_common_tests->new( NEW."Id" = GEN_ID("Gen_Firebird_Loader_Test1_Id",1); END }, + q{ + CREATE VIEW firebird_loader_test2 AS SELECT * FROM "Firebird_Loader_Test1" + }, ], pre_drop_ddl => [ + 'DROP VIEW firebird_loader_test2', 'DROP TRIGGER "Firebird_Loader_Test1_BI"', 'DROP GENERATOR "Gen_Firebird_Loader_Test1_Id"', 'DROP TABLE "Firebird_Loader_Test1"', @@ -175,6 +179,15 @@ my $tester = dbixcsl_common_tests->new( is eval { $rsrc->column_info('Foo')->{default_value} }, 42, 'default_value detected for mixed case column'; + # test that views are marked as such + my $view_source = $schema->resultset($monikers->{firebird_loader_test2})->result_source; + isa_ok $view_source, 'DBIx::Class::ResultSource::View', + 'view result source'; + + like $view_source->view_definition, + qr/\A \s* select\b .* \bfrom \s+ (?-i:"Firebird_Loader_Test1") \s* \z/imsx, + 'view definition'; + # test the fixed up ->_dbh_type_info_type_name for the ODBC driver if ($schema->storage->_dbi_connect_info->[0] =~ /:ODBC:/i) { my %truncated_types = (