[Rt-commit] r14699 - rt/3.8/trunk/t/web
ruz at bestpractical.com
ruz at bestpractical.com
Thu Jul 31 18:12:10 EDT 2008
Author: ruz
Date: Thu Jul 31 18:12:10 2008
New Revision: 14699
Added:
rt/3.8/trunk/t/web/ticket-create-utf8.t
Log:
* add tests of creating tickets with international characters in Subject
and/or Content, one fails, will fix soon
Added: rt/3.8/trunk/t/web/ticket-create-utf8.t
==============================================================================
--- (empty file)
+++ rt/3.8/trunk/t/web/ticket-create-utf8.t Thu Jul 31 18:12:10 2008
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More tests => 8;
+use RT::Test;
+
+use Encode;
+
+my $str_ru_test = "\x{442}\x{435}\x{441}\x{442}";
+my $oct_ru_test = Encode::encode_utf8( $str_ru_test );
+my $str_ru_autoreply = "\x{410}\x{432}\x{442}\x{43e}\x{43e}\x{442}\x{432}\x{435}\x{442}";
+my $oct_ru_autoreply = Encode::encode_utf8( $str_ru_autoreply );
+my $str_ru_support = "\x{43f}\x{43e}\x{434}\x{434}\x{435}\x{440}\x{436}\x{43a}\x{430}";
+my $oct_ru_support = Encode::encode_utf8( $str_ru_support );
+
+my $q = RT::Test->load_or_create_queue( Name => 'Regression' );
+ok $q && $q->id, 'loaded or created queue';
+
+RT::Test->set_rights(
+ Principal => 'Everyone',
+ Right => ['CreateTicket', 'ShowTicket', 'SeeQueue', 'ReplyToTicket', 'ModifyTicket'],
+);
+
+my ($baseurl, $m) = RT::Test->started_ok;
+ok $m->login, 'logged in';
+
+# create a ticket with a subject only
+{
+ ok $m->goto_create_ticket( $q ), "go to create ticket";
+ $m->form_number(3);
+ $m->field( Subject => $oct_ru_test );
+ $m->submit;
+
+ $m->content_like(
+ qr{<td\s+class="message-header-value"[^>]*>\s*\Q$oct_ru_test\E\s*</td>}i,
+ 'header on the page'
+ );
+}
+
+# create a ticket with a subject and content
+{
+ ok $m->goto_create_ticket( $q ), "go to create ticket";
+ $m->form_number(3);
+ $m->field( Subject => $oct_ru_test );
+ $m->field( Content => $oct_ru_support );
+ $m->submit;
+
+ $m->content_like(
+ qr{<td\s+class="message-header-value"[^>]*>\s*\Q$oct_ru_test\E\s*</td>}i,
+ 'header on the page'
+ );
+ $m->content_like(
+ qr{\Q$oct_ru_support\E}i,
+ 'content on the page'
+ );
+}
More information about the Rt-commit
mailing list