[Rt-commit] rt branch, 3.999-trunk, updated. 89cba24be778542f3237d8c4323813f7264737eb

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Nov 5 19:40:38 EST 2009


The branch, 3.999-trunk has been updated
       via  89cba24be778542f3237d8c4323813f7264737eb (commit)
      from  af525c71ca4397beabb31762ed5cc4b45089fd71 (commit)

Summary of changes:
 t/web/basic.t              |   11 +++++------
 t/web/ticket-create-utf8.t |    6 ++++--
 2 files changed, 9 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit 89cba24be778542f3237d8c4323813f7264737eb
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Nov 6 08:38:50 2009 +0800

    update utf8 tests

diff --git a/t/web/basic.t b/t/web/basic.t
index 424820f..0897ff2 100644
--- a/t/web/basic.t
+++ b/t/web/basic.t
@@ -39,9 +39,10 @@ $agent->get($url."/Ticket/Create.html?queue=1");
 is ($agent->{'status'}, 200, "Loaded Create.html");
 $agent->form_number(3);
 # Start with a string containing characters in latin1
-my $string = Encode::decode_utf8("I18N Web Testing æøå");
+my $string = "I18N Web Testing æøå";
+my $decoded_string = Encode::decode_utf8($string);
 $agent->field('subject' => "Ticket with utf8 body");
-$agent->field('content' => $string);
+$agent->field('content' => $decoded_string);
 ok($agent->submit(), "Created new ticket with $string as content");
 like( $agent->{'content'}, qr{$string} , "Found the content");
 ok($agent->{redirected_uri}, "Did redirection");
@@ -49,12 +50,10 @@ ok($agent->{redirected_uri}, "Did redirection");
 $agent->get($url."/Ticket/Create.html?queue=1");
 is ($agent->{'status'}, 200, "Loaded Create.html");
 $agent->form_number(3);
-# Start with a string containing characters in latin1
-$string = Encode::decode_utf8("I18N Web Testing æøå");
-$agent->field('subject' => $string);
+
+$agent->field('subject' => $decoded_string);
 $agent->field('content' => "Ticket with utf8 subject");
 ok($agent->submit(), "Created new ticket with $string as subject");
-
 like( $agent->{'content'}, qr{$string} , "Found the content");
 
 # Update time worked in hours
diff --git a/t/web/ticket-create-utf8.t b/t/web/ticket-create-utf8.t
index 3ad7da1..745f3c4 100644
--- a/t/web/ticket-create-utf8.t
+++ b/t/web/ticket-create-utf8.t
@@ -43,12 +43,14 @@ ok $m->login, 'logged in';
     $m->field( content => $ru_support );
     $m->submit;
 
+    my $encoded_ru_test = Encode::encode_utf8( $ru_test );
+    my $encoded_ru_support = Encode::encode_utf8( $ru_support );
     $m->content_like( 
-        qr{<td\s+class="message-header-value"[^>]*>\s*\Q$ru_test\E\s*</td>}i,
+        qr{<td\s+class="message-header-value"[^>]*>\s*\Q$encoded_ru_test\E\s*</td>}i,
         'header on the page'
     );
     $m->content_like( 
-        qr{\Q$ru_support\E}i,
+        qr{\Q$encoded_ru_support\E}i,
         'content on the page'
     );
 }

-----------------------------------------------------------------------


More information about the Rt-commit mailing list