[Rt-commit] r5030 - in rtir/branches/1.9-EXPERIMENTAL: t

ruz at bestpractical.com ruz at bestpractical.com
Thu Apr 13 11:59:25 EDT 2006


Author: ruz
Date: Thu Apr 13 11:59:24 2006
New Revision: 5030

Added:
   rtir/branches/1.9-EXPERIMENTAL/t/008-workflow-blocks.t
Modified:
   rtir/branches/1.9-EXPERIMENTAL/   (props changed)
   rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl

Log:
 r1299 at cubic-pc:  cubic | 2006-04-13 20:06:23 +0400
 * blocks workflow tests


Added: rtir/branches/1.9-EXPERIMENTAL/t/008-workflow-blocks.t
==============================================================================
--- (empty file)
+++ rtir/branches/1.9-EXPERIMENTAL/t/008-workflow-blocks.t	Thu Apr 13 11:59:24 2006
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More qw(no_plan);
+
+require "t/rtir-test.pl";
+
+my $agent = default_agent();
+
+my $inc_id   = create_incident($agent, {Subject => "incident with block"});
+my $block_id = create_block($agent, {Subject => "block"});
+
+display_ticket($agent, $block_id);
+ok_and_content_like($agent, qr{State.*?pending activation}, 'checked state of the new block');
+
+$agent->follow_link_ok({ text => "[Link]" }, "Followed '[Link]' link");
+$agent->form_number(2);
+$agent->field('SelectedTicket', $inc_id);
+$agent->click('LinkChild');
+ok_and_content_like($agent, qr{$block_id.*block.*?pending activation}, 'have child link');
+
+$agent->follow_link_ok({ text => $block_id }, "Followed link back to block");
+ok_and_content_like($agent, qr{State.*?pending activation}, 'checked state of the new block');
+$agent->has_tag('a', 'Remove', 'we have Remove action');
+$agent->has_tag('a', 'Quick Remove', 'we have Quick Remove action');
+
+my %state = (
+    new      => 'pending activation',
+    open     => 'active',
+    stalled  => 'pending removal',
+    resolved => 'removed',
+    rejected => 'removed',
+);
+
+foreach my $status( qw(open stalled resolved) ) {
+    $agent->follow_link_ok({ text => "Edit" }, "Goto edit page");
+    $agent->form_number(2);
+    $agent->field(Status => $status);
+    $agent->click('SaveChanges');
+    my $state = $state{ $status };
+    ok_and_content_like($agent, qr{State.*?\Q$state}, 'changed state block');
+}
+
+
+$agent->follow_link_ok({ text => "Edit" }, "Goto edit page");
+$agent->form_number(2);
+$agent->field(Status => 'resolved');
+$agent->click('SaveChanges');
+ok_and_content_like($agent, qr{State.*?removed}, 'changed state block');
+$agent->has_tag('a', 'Activate', 'we have Activate action');
+
+$agent->follow_link_ok({ text => 'Activate' }, "Reactivate block");
+ok_and_content_like($agent, qr{State.*?active}, 'checked state of the block');
+$agent->has_tag('a', 'Pending Removal', 'we have Pending Removal action tab');
+
+$agent->follow_link_ok({ text => 'Pending Removal' }, "Prepare block for remove");
+$agent->form_number(2);
+$agent->click('SubmitTicket');
+ok_and_content_like($agent, qr{State.*?pending removal}, 'checked state of the block');
+
+
+
+

Modified: rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl	(original)
+++ rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl	Thu Apr 13 11:59:24 2006
@@ -141,8 +141,14 @@
         set_custom_field($agent, $f, $v);
     }
 
+    my %create = (
+        'Incident Reports' => 'Create',
+        'Investigations'   => 'Create',
+        'Blocks'           => 'Create',
+        'Incidents'        => 'CreateIncident',
+    );
     # Create it!
-    $agent->click("Create");
+    $agent->click( $create{ $queue } );
     
     is ($agent->status, 200, "Attempted to create the ticket");
 


More information about the Rt-commit mailing list