[Bps-public-commit] r15560 - in sd/trunk: .

sartak at bestpractical.com sartak at bestpractical.com
Wed Aug 27 14:58:29 EDT 2008


Author: sartak
Date: Wed Aug 27 14:58:28 2008
New Revision: 15560

Modified:
   sd/trunk/   (props changed)
   sd/trunk/t/sd-rt.t

Log:
 r70588 at onn:  sartak | 2008-08-27 14:58:21 -0400
 Test that commenting on and then resolving a ticket leaves the ticket resolved when pushed to RT


Modified: sd/trunk/t/sd-rt.t
==============================================================================
--- sd/trunk/t/sd-rt.t	(original)
+++ sd/trunk/t/sd-rt.t	Wed Aug 27 14:58:28 2008
@@ -15,7 +15,7 @@
     }
 }
 
-use Prophet::Test tests => 27;
+use Prophet::Test tests => 37;
 use App::SD::Test;
 
 no warnings 'once';
@@ -212,7 +212,42 @@
 
 like($out, qr/Cc:\s*hiro\@example.com/);
 
+diag("resolve and comment on a ticket");
 
+$ticket = RT::Client::REST::Ticket->new(
+    rt      => $rt,
+    queue   => 'General',
+    status  => 'new',
+    subject => 'helium',
+)->store( text => "Ticket Comment" );
+
+( $ret, $out, $err ) = run_script( 'sd', [ 'pull', '--from',  $sd_rt_url ] );
+ok($ret, $out);
+
+my $helium_id;
+run_output_matches( 'sd', [ 'ticket', 'list', '--regex', 'helium' ],
+    [qr/(.*?)(?{ $helium_id = $1 }) helium new/] );
+
+( $ret, $out, $err ) = run_script( 'sd', [ 'ticket', 'comment', $helium_id, '--content', 'helium is a noble gas' ] );
+ok($ret, $out);
+like($out, qr/Created comment/);
+
+( $ret, $out, $err ) = run_script( 'sd', [ 'ticket', 'resolve', $helium_id ]);
+ok($ret, $out);
+like($out, qr/ticket .* updated/);
+
+( $ret, $out, $err ) = run_script( 'sd', [ 'push', '--to', $sd_rt_url ] );
+ok($ret, $out);
+
+( $ret, $out, $err ) = run_script( 'sd', [ 'pull', '--from',  $sd_rt_url ] );
+ok($ret, $out);
+like($out, qr/No new changesets/);
+
+my $fetched_ticket = RT::Client::REST::Ticket->new(
+    rt => $rt,
+    id => $ticket->id)->retrieve;
+
+is($fetched_ticket->status, "resolved");
 
 sub get_rt_ticket_attachments {
     my $ticket = shift;



More information about the Bps-public-commit mailing list