first pass RT4 merge, RT#13852
[freeside.git] / rt / t / api / txn_content.t
1 use warnings;
2 use strict;
3
4 use RT::Test tests => 3;
5 use MIME::Entity;
6 my $ticket = RT::Ticket->new(RT->SystemUser);
7 my $mime   = MIME::Entity->build(
8     From => 'test@example.com',
9     Type => 'text/html',
10     Data => ["this is body\n"],
11 );
12 $mime->attach( Data => ['this is attachment'] );
13 my $id = $ticket->Create( MIMEObj => $mime, Queue => 'General' );
14 ok( $id, "created ticket $id" );
15 my $txns = $ticket->Transactions;
16 $txns->Limit( FIELD => 'Type', VALUE => 'Create' );
17 my $txn = $txns->First;
18 ok( $txn, 'got Create txn' );
19 is( $txn->Content, "this is body\n", "txn's content" );