[Bps-public-commit] r17148 - sd/trunk/t/sd-hm

ruz at bestpractical.com ruz at bestpractical.com
Tue Dec 9 08:43:47 EST 2008


Author: ruz
Date: Tue Dec  9 08:43:43 2008
New Revision: 17148

Modified:
   sd/trunk/t/sd-hm/push-reporter-not-pro.t

Log:
* add more tests on requestors updates

Modified: sd/trunk/t/sd-hm/push-reporter-not-pro.t
==============================================================================
--- sd/trunk/t/sd-hm/push-reporter-not-pro.t	(original)
+++ sd/trunk/t/sd-hm/push-reporter-not-pro.t	Tue Dec  9 08:43:43 2008
@@ -6,7 +6,7 @@
 
 BEGIN {
     if ( $ENV{'JIFTY_APP_ROOT'} ) {
-        plan tests => 22;
+        plan tests => 29;
         require File::Temp;
         $ENV{'PROPHET_REPO'} = $ENV{'SD_REPO'} = File::Temp::tempdir( CLEANUP => 0 ) . '/_svb';
         diag $ENV{'PROPHET_REPO'};
@@ -89,6 +89,23 @@
     like( $comment, qr/test\@localhost/, "there is comment" );
 }
 
+diag("from requestor to no requestor");
+{
+    flush_sd();
+    my ($luid, $uuid) = create_ticket_ok(qw(--summary YATTA --status new --reporter onlooker at example.com));
+    update_ticket_ok($uuid, '--reporter', '');
+    my ($ret, $out, $err) = run_script( 'sd', ['push', '--to', $sd_hm_url] );
+    diag $err;
+
+    my $task = load_new_hm_task();
+    is $task->requestor->email, 'onlooker at example.com', 'correct email';
+
+    my $comments = $task->comments;
+    is( $comments->count, 2, "there are two comments" );
+    my $comment = do { $comments->next; $comments->next->formatted_body };
+    like( $comment, qr/All requestors have been deleted/, "there is comment" );
+}
+
 sub flush_sd {
     use File::Path qw(rmtree);
     rmtree( $ENV{'SD_REPO'} );



More information about the Bps-public-commit mailing list