[Bps-public-commit] Prophet branch, master, updated. 0.69_01-52-ga90e8d7

spang at bestpractical.com spang at bestpractical.com
Thu Sep 3 20:07:32 EDT 2009


The branch, master has been updated
       via  a90e8d740acb375bb18db06218d8f1e3f18c9938 (commit)
      from  3d5a46b5dd5f3f9daf4565e620660f47cd4091fa (commit)

Summary of changes:
 t/record-types.t |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 t/record-types.t

- Log -----------------------------------------------------------------
commit a90e8d740acb375bb18db06218d8f1e3f18c9938
Author: Christine Spang <spang at bestpractical.com>
Date:   Thu Sep 3 20:07:23 2009 -0400

    Regression test for jesse's fixes

diff --git a/t/record-types.t b/t/record-types.t
new file mode 100644
index 0000000..2d80006
--- /dev/null
+++ b/t/record-types.t
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+use strict;
+
+use Prophet::Test tests => 3;
+
+BEGIN {
+    require File::Temp;
+    $ENV{'PROPHET_REPO'} = File::Temp::tempdir(
+        CLEANUP => ! $ENV{PROPHET_DEBUG}  ) . '/repo-' . $$;
+    diag $ENV{'PROPHET_REPO'};
+}
+
+# regression test: bad things happen when you're allowed to e.g., update
+# a record of type comment when your context's type is set to ticket
+
+run_command( 'init', '--non-interactive' );
+
+my ($ticket_id, $ticket_uuid)
+    = (run_command( qw(create --type ticket -- status=new) )
+            =~ qr/Created ticket (\d+) \((\S+)\)/);
+
+ok( $ticket_uuid, "Created ticket record $ticket_id" );
+
+my ($comment_id, $comment_uuid)
+    = (run_command( qw(create --type comment -- content="yay!") )
+            =~ qr/Created comment (\d+) \((\S+)\)/);
+
+ok( $comment_uuid, "Created comment record $comment_id" );
+
+my ($output, $error)
+    = (run_command( qw(update --type ticket --id), $comment_id,
+            qw(-- status=closed) ) );
+
+like( $error, qr/couldn't find/,
+    "Couldn't update comment record as ticket type" );

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list