journal_no_auto_deploy
Yuval Kogman [Tue, 29 Jul 2008 17:54:05 +0000 (17:54 +0000)]
t/01test.t
t/lib/DBICTest/Schema.pm

index 7b5b4f1..9f419af 100644 (file)
@@ -10,7 +10,7 @@ BEGIN {
     eval "use DBD::SQLite";
     plan $@
         ? ( skip_all => 'needs DBD::SQLite for testing' )
-        : ( tests => 12 );
+        : ( tests => 14 );
 }
 
 my $schema = DBICTest->init_schema(no_populate => 1);
@@ -20,6 +20,18 @@ isa_ok($schema->_journal_schema, 'DBIx::Class::Schema::Journal::DB', 'Actually h
 isa_ok($schema->_journal_schema->source('CDAuditHistory'), 'DBIx::Class::ResultSource', 'CDAuditHistory source exists');
 isa_ok($schema->_journal_schema->source('ArtistAuditLog'), 'DBIx::Class::ResultSource', 'ArtistAuditLog source exists');
 
+{
+       my $count = eval { 
+               warn $schema->_journal_schema->resultset('ArtistAuditLog')->count;
+       };
+       my $e = $@;
+
+       is( $count, undef, "no count" );
+       like( $e, qr/table.*artist_audit_log/i, "missing table error" );
+}
+
+$schema->journal_schema_deploy();
+
 my $artist;
 my $new_cd = $schema->txn_do( sub {
     $artist = $schema->resultset('Artist')->create({
index 2650f3e..ffe1777 100644 (file)
@@ -5,8 +5,9 @@ use base qw/DBIx::Class::Schema/;
 
 __PACKAGE__->load_components(qw/+DBIx::Class::Schema::Journal/);
 
+__PACKAGE__->journal_no_automatic_deploy(1);
+
 __PACKAGE__->journal_connection(['dbi:SQLite:t/var/Audit.db']);
-__PACKAGE__->journal_user(['DBICTest::Schema::Artist', {'foreign.artistid' => 'self.user_id'}]);
 
 no warnings qw/qw/;
 DBICTest::Schema->load_classes(