[Rt-commit] rt branch, 4.2/remove-warning-dependence, created. rt-4.1.8-261-gf2eb0c9

Alex Vandiver alexmv at bestpractical.com
Mon May 6 21:11:25 EDT 2013


The branch, 4.2/remove-warning-dependence has been created
        at  f2eb0c91264909dd262575f8fe62493c0dd7d346 (commit)

- Log -----------------------------------------------------------------
commit f2eb0c91264909dd262575f8fe62493c0dd7d346
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Jun 7 23:17:54 2012 -0400

    Ensure that tests pass no matter if prove is passed -w
    
    7f3d9c1 added the queue name to the warning.  However, in cases where no
    Queue parameter is supplied (as in t/web/csrf.t), this can cause
    warnings -- but only if the test is run with `prove -w`.  48531b2,
    during the merge from 4.0-trunk, modified the test to expect the
    warning, but this causes tests to fail when not run with -w.  While
    tests should nominally always be run with -w, they should not
    mysteriously fail when it is omitted.
    
    Warning-proof the error message so that the test need no longer check
    for the (unrelated, in any case) warning.

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index f9de896..ed9ad2a 100644
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -365,7 +365,7 @@ my @results;
 my $title = loc("Create a new ticket");
 
 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
-$QueueObj->Load($Queue) || Abort(loc("Queue [_1] could not be loaded.", $Queue));
+$QueueObj->Load($Queue) || Abort(loc("Queue [_1] could not be loaded.", $Queue||''));
 
 $m->callback( QueueObj => $QueueObj, title => \$title, results => \@results, ARGSRef => \%ARGS );
 
diff --git a/t/web/csrf.t b/t/web/csrf.t
index 753bef5..9d95d06 100644
--- a/t/web/csrf.t
+++ b/t/web/csrf.t
@@ -101,9 +101,7 @@ my $link = $m->find_link(text_regex => qr{resume your request});
 $m->get_ok($broken_url);
 $m->content_like(qr/Queue\s+could not be loaded/);
 $m->title_is('RT Error');
-$m->next_warning_like(qr/Use of uninitialized value/);
-$m->next_warning_like(qr/Queue\s+could not be loaded/);
-$m->no_leftover_warnings_ok;
+$m->warning_like(qr/Queue\s+could not be loaded/);
 
 # The token doesn't work for other pages, or other arguments to the same page.
 $m->add_header(Referer => undef);

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


More information about the Rt-commit mailing list