Permalink
Browse files

more tests to include hotlist and search by name

  • Loading branch information...
1 parent 869ac40 commit 8a0e7c39b45ad763be500e4f87e9c9be50680ee5 sunnavy committed Oct 27, 2010
Showing with 68 additions and 12 deletions.
  1. +68 −12 t/10-queue-specific-class.t
@@ -4,7 +4,7 @@ use strict;
use warnings;
use lib 't/lib';
-use RT::FM::Test tests => 36;
+use RT::FM::Test tests => 57;
my ( $url, $m ) = RT::Test->started_ok;
$m->login;
@@ -19,7 +19,7 @@ for my $name ( keys %class ) {
$m->submit_form(
form_number => 3,
- fields => { Name => $name }
+ fields => { Name => $name, HotList => 1 },
);
$m->content_contains( "Editing Configuration for Class $name",
@@ -75,12 +75,35 @@ diag "update ticket to see if there is article foo"
{
$m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
'ticket update page' );
+ $m->content_contains( 'article foo:', 'got article foo in hotlist' );
+ $m->content_lacks( 'article bar:', 'no article bar in hotlist' );
+
$m->submit_form(
form_number => 3,
fields => { 'RTFM_Content' => 'article' },
button => 'Go',
);
- $m->content_contains( 'article foo', 'got article foo' );
+ $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
+ $m->content_lacks( 'article bar', 'no article bar' );
+
+ $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
+ 'ticket update page' );
+ $m->submit_form(
+ form_number => 3,
+ fields => { 'RTFM-Include-Article-Named' => 'article foo' },
+ button => 'Go',
+ );
+ $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
+ $m->content_lacks( 'article bar', 'no article bar' );
+
+ $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
+ 'ticket update page' );
+ $m->submit_form(
+ form_number => 3,
+ fields => { 'RTFM-Include-Article-Named' => 'articlei bar' },
+ button => 'Go',
+ );
+ $m->content_unlike( qr/article foo.*article foo/s, 'no article foo' );
$m->content_lacks( 'article bar', 'no article bar' );
}
@@ -102,30 +125,39 @@ diag "update ticket to see if there are both article foo and bar"
{
$m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
'ticket update page' );
+ $m->content_contains( 'article foo:', 'got article foo in hotlist' );
+ $m->content_contains( 'article bar:', 'got article bar in hotlist' );
+
$m->submit_form(
form_number => 3,
fields => { 'RTFM_Content' => 'article' },
button => 'Go',
);
- $m->content_contains( 'article foo', 'got article foo' );
- $m->content_contains( 'article bar', 'got article bar' );
-}
+ $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
+ $m->content_like( qr/article bar.*article bar/s, 'selected article bar' );
-diag "update ticket to see if there are both article foo and bar"
- if $ENV{TEST_VERBOSE};
+ $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
+ 'ticket update page' );
+ $m->submit_form(
+ form_number => 3,
+ fields => { 'RTFM-Include-Article-Named' => 'article foo' },
+ button => 'Go',
+ );
+ $m->content_like( qr/article foo.*article foo/s, 'selected article foo' );
+ $m->content_unlike( qr/article bar.*article bar/s, 'no article bar' );
-{
$m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
'ticket update page' );
$m->submit_form(
form_number => 3,
- fields => { 'RTFM_Content' => 'article' },
+ fields => { 'RTFM-Include-Article-Named' => 'article bar' },
button => 'Go',
);
- $m->content_contains( 'article foo', 'got article foo' );
- $m->content_contains( 'article bar', 'got article bar' );
+ $m->content_like( qr/article bar.*article bar/s, 'selected article bar' );
+ $m->content_unlike( qr/article foo.*article foo/s, 'no article foo' );
}
+
diag "remove both foo and bar" if $ENV{TEST_VERBOSE};
{
$m->get_ok( '/Admin/RTFM/Classes/Objects.html?id=' . $class{foo},
@@ -153,11 +185,35 @@ diag "update ticket to see if there are both article foo and bar"
{
$m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
'ticket update page' );
+ $m->content_lacks( 'article foo:', 'no article foo in hotlist' );
+ $m->content_lacks( 'article bar:', 'no article bar in hotlist' );
+
$m->submit_form(
form_number => 3,
fields => { 'RTFM_Content' => 'article' },
button => 'Go',
);
$m->content_lacks( 'article foo', 'no article foo' );
$m->content_lacks( 'article bar', 'no article bar' );
+
+ $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
+ 'ticket update page' );
+ $m->submit_form(
+ form_number => 3,
+ fields => { 'RTFM-Include-Article-Named' => 'article foo' },
+ button => 'Go',
+ );
+ $m->content_lacks( 'article foo', 'no article foo' );
+ $m->content_lacks( 'article bar', 'no article bar' );
+
+ $m->get_ok( '/Ticket/Update.html?Action=Comment&id=' . $ticket_id,
+ 'ticket update page' );
+ $m->submit_form(
+ form_number => 3,
+ fields => { 'RTFM-Include-Article-Named' => 'article bar' },
+ button => 'Go',
+ );
+ $m->content_lacks( 'article foo', 'no article foo' );
+ $m->content_lacks( 'article bar', 'no article bar' );
}
+

0 comments on commit 8a0e7c3

Please sign in to comment.