[Bps-public-commit] r16903 - sd/trunk/t/sd-rt

jesse at bestpractical.com jesse at bestpractical.com
Tue Nov 18 18:21:31 EST 2008


Author: jesse
Date: Tue Nov 18 18:21:31 2008
New Revision: 16903

Removed:
   sd/trunk/t/sd-rt/delete.t
Modified:
   sd/trunk/t/sd-rt/basic.t

Log:
* A failing test for ticket deletion being propagated to rt

Modified: sd/trunk/t/sd-rt/basic.t
==============================================================================
--- sd/trunk/t/sd-rt/basic.t	(original)
+++ sd/trunk/t/sd-rt/basic.t	Tue Nov 18 18:21:31 2008
@@ -15,7 +15,7 @@
     }
 }
 
-use Prophet::Test tests => 37;
+use Prophet::Test tests => 43;
 use App::SD::Test;
 
 no warnings 'once';
@@ -49,6 +49,8 @@
     subject => 'Fly Man',
 )->store( text => "Ticket Comment" );
 
+my $flyman_rt_id = $ticket->id;
+
 my ( $ret, $out, $err );
 ( $ret, $out, $err ) = run_script( 'sd', [ 'clone', '--from', $sd_rt_url ] );
 my ( $yatta_id, $flyman_id );
@@ -261,23 +263,54 @@
 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 );
+{    # resolve a ticket
+    ( $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" );
+}
+
+{    # delete a ticket for reals
+    ( $ret, $out, $err )
+        = run_script( 'sd', [ 'ticket','delete', $flyman_id]);
+    ok( $ret, $out );
+    like( $out, qr/ticket .* deleted/ );
+
+    ( $ret, $out, $err ) = run_script( 'sd', [ 'push', '--to', $sd_rt_url ] );
+    ok( $ret, $out );
+    diag($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 => $flyman_rt_id 
+    )->retrieve;
+
+    is( $fetched_ticket->status, "deleted" );
+
+}
+
+
 
-( $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