[Rt-commit] r5160 - in rtir/branches/1.9-EXPERIMENTAL: t
ruz at bestpractical.com
ruz at bestpractical.com
Wed May 3 19:34:23 EDT 2006
Author: ruz
Date: Wed May 3 19:34:22 2006
New Revision: 5160
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/t/008-workflow-blocks.t
rtir/branches/1.9-EXPERIMENTAL/t/rtir-test.pl
Log:
r1403 at cubic-pc: cubic | 2006-05-04 03:40:31 +0400
* state may have spaces in the middle
* update blocks workflow to use function from utils to test for state
Modified: rtir/branches/1.9-EXPERIMENTAL/t/008-workflow-blocks.t
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/t/008-workflow-blocks.t (original)
+++ rtir/branches/1.9-EXPERIMENTAL/t/008-workflow-blocks.t Wed May 3 19:34:22 2006
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 38;
+use Test::More tests => 37;
require "t/rtir-test.pl";
@@ -11,8 +11,7 @@
my $inc_id = create_incident($agent, {Subject => "incident with block"});
my $block_id = create_block($agent, {Subject => "block", Incident => $inc_id});
-display_ticket($agent, $block_id);
-ok_and_content_like($agent, qr{State.*?pending activation}, 'checked state of the new block');
+ticket_state_is($agent, $block_id, 'pending activation');
# XXX: Comment this tests as we don't allow to create blocks without an incident
# XXX: we need test for this fact
@@ -23,7 +22,7 @@
#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');
+#ticket_state_is($agent, $block_id, 'pending activation');
$agent->has_tag('a', 'Remove', 'we have Remove action');
$agent->has_tag('a', 'Quick Remove', 'we have Quick Remove action');
@@ -42,7 +41,7 @@
$agent->field(Status => $status);
$agent->click('SaveChanges');
my $state = $state{ $status };
- ok_and_content_like($agent, qr{State.*?\Q$state}, 'changed state block');
+ ticket_state_is($agent, $block_id, $state);
}
@@ -50,17 +49,17 @@
$agent->form_number(2);
$agent->field(Status => 'resolved');
$agent->click('SaveChanges');
-ok_and_content_like($agent, qr{State.*?removed}, 'changed state block');
+ticket_state_is($agent, $block_id, 'removed');
$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');
+ticket_state_is($agent, $block_id, 'active');
$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');
+ticket_state_is($agent, $block_id, 'pending removal');
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 Wed May 3 19:34:22 2006
@@ -73,7 +73,7 @@
my $state = shift;
my $desc = shift || "State of the ticket #$id is '$state'";
display_ticket( $agent, $id );
- $agent->content =~ qr{State:\s*</td>\s*<td[^>]*?>\s*<span class="cf-value">(\w+)</span>}ism;
+ $agent->content =~ qr{State:\s*</td>\s*<td[^>]*?>\s*<span class="cf-value">([\w ]+)</span>}ism;
return is($1, $state, $desc);
}
More information about the Rt-commit
mailing list