X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Ft%2Fapi%2Ftxn_content.t;h=672d6c2e0214ba436faffcc867ec85b344833808;hb=e131b1f71f08b69abb832c1687d1f29682d171f8;hp=0f5d78ca979f14a9fb973658b563a727210dc436;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/rt/t/api/txn_content.t b/rt/t/api/txn_content.t index 0f5d78ca9..672d6c2e0 100644 --- a/rt/t/api/txn_content.t +++ b/rt/t/api/txn_content.t @@ -1,9 +1,9 @@ use warnings; use strict; -use RT::Test tests => 3; +use RT::Test tests => 4; use MIME::Entity; -my $ticket = RT::Ticket->new($RT::SystemUser); +my $ticket = RT::Ticket->new(RT->SystemUser); my $mime = MIME::Entity->build( From => 'test@example.com', Type => 'text/html', @@ -16,4 +16,8 @@ my $txns = $ticket->Transactions; $txns->Limit( FIELD => 'Type', VALUE => 'Create' ); my $txn = $txns->First; ok( $txn, 'got Create txn' ); -is( $txn->Content, "this is body\n", "txn's content" ); + +# ->Content converts from text/html to plain text if we don't explicitly ask +# for html. Our html -> text converter seems to add an extra trailing newline +like( $txn->Content, qr/^\s*this is body\s*$/, "txn's html content converted to plain text" ); +is( $txn->Content(Type => 'text/html'), "this is body\n", "txn's html content" );