summaryrefslogtreecommitdiff
path: root/rt/lib/t/regression/02basic_web.t
diff options
context:
space:
mode:
authorivan <ivan>2007-08-02 19:56:20 +0000
committerivan <ivan>2007-08-02 19:56:20 +0000
commitef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4 (patch)
treea2ea500cf510739908761a6bfbd14e990131f2cc /rt/lib/t/regression/02basic_web.t
parenta513c0bef534d05f03c1242831b6f3be19b97dae (diff)
import rt 3.6.4
Diffstat (limited to 'rt/lib/t/regression/02basic_web.t')
-rw-r--r--rt/lib/t/regression/02basic_web.t27
1 files changed, 18 insertions, 9 deletions
diff --git a/rt/lib/t/regression/02basic_web.t b/rt/lib/t/regression/02basic_web.t
index d3376d0..3b8619b 100644
--- a/rt/lib/t/regression/02basic_web.t
+++ b/rt/lib/t/regression/02basic_web.t
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 17;
+use Test::More tests => 19;
use WWW::Mechanize;
use HTTP::Request::Common;
use HTTP::Cookies;
@@ -16,10 +16,10 @@ my $agent = WWW::Mechanize->new();
$agent->cookie_jar($cookie_jar);
use RT;
-RT::LoadConfig;
-
+RT::LoadConfig();
# get the top page
my $url = $RT::WebURL;
+diag $url;
$agent->get($url);
is ($agent->{'status'}, 200, "Loaded a page");
@@ -44,17 +44,20 @@ ok( $agent->{'content'} =~ /Logout/i, "Found a logout link");
$agent->get($url."Ticket/Create.html?Queue=1");
is ($agent->{'status'}, 200, "Loaded Create.html");
-$agent->form(3);
+$agent->form_number(3);
# Start with a string containing characters in latin1
my $string = "I18N Web Testing זרו";
Encode::from_to($string, 'iso-8859-1', 'utf8');
$agent->field('Subject' => "Ticket with utf8 body");
$agent->field('Content' => $string);
ok($agent->submit(), "Created new ticket with $string as Content");
-ok( $agent->{'content'} =~ qr{$string} , "Found the content");
+like( $agent->{'content'}, qr{$string} , "Found the content");
+ok($agent->{redirected_uri}, "Did redirection");
+
+
$agent->get($url."Ticket/Create.html?Queue=1");
is ($agent->{'status'}, 200, "Loaded Create.html");
-$agent->form(3);
+$agent->form_number(3);
# Start with a string containing characters in latin1
my $string = "I18N Web Testing זרו";
Encode::from_to($string, 'iso-8859-1', 'utf8');
@@ -62,9 +65,15 @@ $agent->field('Subject' => $string);
$agent->field('Content' => "Ticket with utf8 subject");
ok($agent->submit(), "Created new ticket with $string as Subject");
-ok( $agent->{'content'} =~ qr{$string} , "Found the content");
+like( $agent->{'content'}, qr{$string} , "Found the content");
+# Update time worked in hours
+$agent->follow_link( text_regex => qr/Basics/ );
+$agent->submit_form( form_number => 3,
+ fields => { TimeWorked => 5, 'TimeWorked-TimeUnits' => "hours" }
+);
+like ($agent->{'content'}, qr/to &#39;300&#39;/, "5 hours is 300 minutes");
# }}}
@@ -82,14 +91,14 @@ ok($agent->form_name('BuildQuery'));
$agent->field("AttachmentField", "Subject");
$agent->field("AttachmentOp", "LIKE");
$agent->field("ValueOfAttachment", "aaa");
-$agent->submit();
+$agent->submit("AddClause");
# set the next value
ok($agent->form_name('BuildQuery'));
$agent->field("AttachmentField", "Subject");
$agent->field("AttachmentOp", "LIKE");
$agent->field("ValueOfAttachment", "bbb");
-$agent->submit();
+$agent->submit("AddClause");
ok($agent->form_name('BuildQuery'));