[Rt-commit] rt branch, 4.2/remove-warning-dependence, created. rt-4.0.6-335-g52ed60f

Alex Vandiver alexmv at bestpractical.com
Thu Jun 7 23:22:12 EDT 2012


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

- Log -----------------------------------------------------------------
commit 52ed60f523688c26d75e937f6d56a53d53a881f0
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 d0d99ab..2342a40 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -347,7 +347,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 714e792..c41565c 100644
--- a/t/web/csrf.t
+++ b/t/web/csrf.t
@@ -102,9 +102,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