4 use RT::Test tests => undef;
6 my ($base, $m) = RT::Test->started_ok;
7 ok $m->login, 'logged in';
11 diag "create a ticket via the API";
13 my $ticket = RT::Ticket->new( RT->SystemUser );
14 my ($id, $txn, $msg) = $ticket->Create(
16 Subject => Encode::decode("UTF-8",'bad subject‽'),
18 ok $id, 'created a ticket #'. $id or diag "error: $msg";
19 is $ticket->Subject, Encode::decode("UTF-8",'bad subject‽'), 'correct subject';
23 diag "create a ticket via the web";
26 form_name => "CreateTicketInQueue",
27 fields => { Queue => 1 },
28 }, 'create ticket in Queue');
31 Subject => Encode::decode("UTF-8",'bad subject #2‽'),
34 $m->content_contains(Encode::decode("UTF-8",'bad subject #2‽'), 'correct subject');
38 diag "create a ticket via the web without a unicode subject";
41 with_fields => { Queue => 1 },
42 }, 'create ticket in Queue');
45 Subject => 'a fine subject #3',
48 $m->content_contains('a fine subject #3', 'correct subject');
52 for my $tid (@tickets) {
54 diag "add a reply which adds to the subject, but without an attachment";
56 $m->goto_ticket($tid);
57 $m->follow_link_ok({ id => 'page-actions-reply' }, "Actions -> Reply");
60 UpdateSubject => Encode::decode("UTF-8",'bad subject‽ without attachment'),
61 UpdateContent => 'testing unicode txn subjects',
63 button => 'SubmitTicket',
65 $m->content_contains(Encode::decode("UTF-8",'bad subject‽ without attachment'), "found txn subject");
68 diag "add a reply which adds to the subject with an attachment";
70 $m->goto_ticket($tid);
71 $m->follow_link_ok({ id => 'page-actions-reply' }, "Actions -> Reply");
74 UpdateSubject => Encode::decode("UTF-8",'bad subject‽ with attachment'),
75 UpdateContent => 'testing unicode txn subjects',
76 Attach => RT::Test::get_relocatable_file('bpslogo.png', '..', 'data'),
78 button => 'SubmitTicket',
80 $m->content_contains(Encode::decode("UTF-8",'bad subject‽ with attachment'), "found txn subject");