X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Ft%2Fweb%2Fcharting.t;h=32d95d99bdf710034461801c3150de8a4d84ee07;hb=a72a10f754f7465121d6137bb3dcee0a21ea6443;hp=7c11f9c9252cfe6cbdf0246f649cc881ecbe1089;hpb=75162bb14b3e38d66617077843f4dfdcaf09d5c4;p=freeside.git
diff --git a/rt/t/web/charting.t b/rt/t/web/charting.t
index 7c11f9c92..32d95d99b 100644
--- a/rt/t/web/charting.t
+++ b/rt/t/web/charting.t
@@ -1,7 +1,16 @@
use strict;
use warnings;
-use RT::Test no_plan => 1;
+BEGIN {
+ require RT::Test;
+
+ if (eval { require GD; 1 }) {
+ RT::Test->import(plan => 'no_plan');
+ }
+ else {
+ RT::Test->import(skip_all => 'GD required.');
+ }
+}
for my $n (1..7) {
my $ticket = RT::Ticket->new( RT->SystemUser );
@@ -26,8 +35,8 @@ ok( $m->login, "Logged in" );
# Test that defaults work
$m->get_ok( "/Search/Chart.html?Query=id>0" );
-$m->content_like(qr{
]*>\s*Queue\s* | \s*]*>\s*Tickets\s* | }, "Grouped by queue");
-$m->content_like(qr{General\s*\s*]*>\s*7}, "Found results in table");
+$m->content_like(qr{ | ]*>Queue\s* | \s*]*>Tickets\s* | }, "Grouped by queue");
+$m->content_like(qr{General\s*\s*]*>\s*]*>7}, "Found results in table");
$m->content_like(qr{ get_ok( "/Search/Chart?Query=id>0" );
@@ -37,8 +46,8 @@ ok( length($m->content), "Has content" );
# Group by Queue
$m->get_ok( "/Search/Chart.html?Query=id>0&PrimaryGroupBy=Queue" );
-$m->content_like(qr{ | ]*>\s*Queue\s* | \s*]*>\s*Tickets\s* | }, "Grouped by queue");
-$m->content_like(qr{General\s*\s*]*>\s*7}, "Found results in table");
+$m->content_like(qr{ | ]*>Queue\s* | \s*]*>Tickets\s* | }, "Grouped by queue");
+$m->content_like(qr{General\s*\s*]*>\s*]*>7}, "Found results in table");
$m->content_like(qr{ get_ok( "/Search/Chart?Query=id>0&PrimaryGroupBy=Queue" );
@@ -48,9 +57,9 @@ ok( length($m->content), "Has content" );
# Group by Requestor email
$m->get_ok( "/Search/Chart.html?Query=id>0&PrimaryGroupBy=Requestor.EmailAddress" );
-$m->content_like(qr{ | ]*>\s*Requestor\.EmailAddress\s* | \s*]*>\s*Tickets\s* | },
+$m->content_like(qr{]*>Requestor\.EmailAddress\s* | \s*]*>Tickets\s* | },
"Grouped by requestor");
-$m->content_like(qr{root0\@localhost\s*\s*]*>\s*3}, "Found results in table");
+$m->content_like(qr{root0\@localhost\s* | \s*]*>\s*]*>3}, "Found results in table");
$m->content_like(qr{ get_ok( "/Search/Chart?Query=id>0&PrimaryGroupBy=Requestor.Email" );
@@ -60,7 +69,7 @@ ok( length($m->content), "Has content" );
# Group by Requestor phone -- which is bogus, and falls back to queue
$m->get_ok( "/Search/Chart.html?Query=id>0&PrimaryGroupBy=Requestor.Phone" );
-$m->content_like(qr{General\s* | \s*]*>\s*7},
+$m->content_like(qr{General\s* | \s*]*>\s*]*>7},
"Found queue results in table, as a default");
$m->content_like(qr{![](/Search/Chart\?}, ) |