[Rt-commit] rt branch, 4.2/different-result-msg-for-comment-reply, created. rt-4.2.4-35-g8f1f011

Alex Vandiver alexmv at bestpractical.com
Fri May 23 17:55:12 EDT 2014


The branch, 4.2/different-result-msg-for-comment-reply has been created
        at  8f1f0119ac616f7ba6147acb1e4516870d15e65a (commit)

- Log -----------------------------------------------------------------
commit 8f1f0119ac616f7ba6147acb1e4516870d15e65a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu May 30 17:32:57 2013 +0400

    return different message for comment and reply
    
    Old "message recorded" is confusing as it doesn't differentiate
    between correspond and comment.

diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 46577e4..6ecaf64 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -1625,7 +1625,14 @@ sub _RecordNote {
         return ( $Trans, $self->loc("Message could not be recorded"), undef );
     }
 
-    return ( $Trans, $self->loc("Message recorded"), $TransObj );
+=for loc
+
+    "Comments added" # loc
+    "Correspondence added" # loc
+
+=cut
+
+    return ( $Trans, $self->loc( $args{'NoteType'} eq 'Comment' ? 'Comments added' : 'Correspondence added' ), $TransObj );
 }
 
 
diff --git a/t/web/command_line.t b/t/web/command_line.t
index 1c17a79..c02c5e9 100644
--- a/t/web/command_line.t
+++ b/t/web/command_line.t
@@ -111,11 +111,11 @@ ok($val,$msg);
 
 # add a comment to ticket
     expect_send("comment -m 'comment-$$' $ticket_id", "Adding a comment...");
-    expect_like(qr/Message recorded/, "Added the comment");
+    expect_like(qr/Comments added/, "Added the comment");
     ### should test to make sure it actually got added
     # add correspondance to ticket (?)
     expect_send("correspond -m 'correspond-$$' $ticket_id", "Adding correspondence...");
-    expect_like(qr/Message recorded/, "Added the correspondence");
+    expect_like(qr/Correspondence added/, "Added the correspondence");
     ### should test to make sure it actually got added
 
     my $test_email = RT::Test::get_relocatable_file('lorem-ipsum',
@@ -522,7 +522,7 @@ sub check_attachment {
     my $attachment_path = shift;
     (my $filename = $attachment_path) =~ s/.*\/(.*)$/$1/;
     expect_send("comment -m 'attach file' -a $attachment_path $ticket_id", "Adding an attachment ($filename)");
-    expect_like(qr/Message recorded/, "Added the attachment");
+    expect_like(qr/Comments added/, "Added the attachment");
     expect_send("show ticket/$ticket_id/attachments","Finding Attachment");
     my $attachment_regex = qr/(\d+):\s+$filename/;
     expect_like($attachment_regex,"Attachment Uploaded");
diff --git a/t/web/ticket_modify_all.t b/t/web/ticket_modify_all.t
index cf398b2..bad87b3 100644
--- a/t/web/ticket_modify_all.t
+++ b/t/web/ticket_modify_all.t
@@ -19,7 +19,7 @@ $m->submit_form(
     button      => 'SubmitTicket',
 );
 
-$m->content_contains("Message recorded", 'updated ticket');
+$m->content_contains("Comments added", 'updated ticket');
 $m->content_lacks("this is update content", 'textarea is clear');
 
 $m->get_ok($url . '/Ticket/Display.html?id=' . $ticket->id );

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


More information about the rt-commit mailing list