use HTTP::Request::Common;
use HTTP::Cookies;
use LWP;
+use Encode;
my $cookie_jar = HTTP::Cookies->new;
my $agent = WWW::Mechanize->new();
# get the top page
-my $url = "http://localhost/";
+my $url = "http://localhost".$RT::WebPath."/";
$agent->get($url);
is ($agent->{'status'}, 200, "Loaded a page");
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);
+# Start with a string containing characters in latin1
+my $string = "I18N Web Testing æøå";
+Encode::from_to($string, 'iso-8859-1', 'utf8');
+$agent->field('Subject' => "Foo");
+$agent->field('Content' => $string);
+ok($agent->submit(), "Created new ticket with $string");
+
+ok( $agent->{'content'} =~ qr{$string} , "Found the content");
+
+$agent->get($url."Ticket/Create.html?Queue=1");
+is ($agent->{'status'}, 200, "Loaded Create.html");
+$agent->form(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' => $string);
+$agent->field('Content' => "BAR");
+ok($agent->submit(), "Created new ticket with $string");
+
+ok( $agent->{'content'} =~ qr{$string} , "Found the content");
+
+
+
+# }}}
+
+
+
use File::Find;
find ( \&wanted , 'html/');