From 365a2b311ab6d38fcc45392515fe0f9c6df859bf Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Sat, 13 May 2017 15:52:47 +0200 Subject: [PATCH 1/3] Don't use numbers as test names. --- t/controller/feed.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/controller/feed.t b/t/controller/feed.t index 58d6c634e9..98d3051d50 100644 --- a/t/controller/feed.t +++ b/t/controller/feed.t @@ -106,7 +106,7 @@ test_psgi app, sub { test_redirect( $cb, 'oalders' ); - subtest '404' => sub { + subtest 'author 404' => sub { my $res = $cb->( GET '/feed/author/XXX343wi^^^' ); is( $res->code, 404, '404 when author does not exist' ); }; From 940453354cd82220c3b5a20c8b42b35f5cd62ebd Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Sat, 13 May 2017 15:56:44 +0200 Subject: [PATCH 2/3] Squash warning when $count is not initialized. --- lib/MetaCPAN/Web/View/HTML.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/MetaCPAN/Web/View/HTML.pm b/lib/MetaCPAN/Web/View/HTML.pm index 342e63085b..30fbf24166 100644 --- a/lib/MetaCPAN/Web/View/HTML.pm +++ b/lib/MetaCPAN/Web/View/HTML.pm @@ -204,6 +204,7 @@ Template::Alloy->define_vmethod( my ( $text, $count ) = @_; # Send args individually since the sub has a prototype. + $count //= 0; return Text::Pluralize::pluralize( $text, $count ); }, ); From d876070e74c07c2ab7ba5cf1620052b6a58c1610 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Sat, 13 May 2017 16:01:34 +0200 Subject: [PATCH 3/3] Squash an uninitialized value warning on a GET that will return 301. --- lib/MetaCPAN/Web/Model/API/Contributors.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/MetaCPAN/Web/Model/API/Contributors.pm b/lib/MetaCPAN/Web/Model/API/Contributors.pm index 30f7cd1cc1..65c4ba9151 100644 --- a/lib/MetaCPAN/Web/Model/API/Contributors.pm +++ b/lib/MetaCPAN/Web/Model/API/Contributors.pm @@ -27,6 +27,9 @@ sub get { my ( $self, $author, $release ) = @_; my $cv = $self->cv; + # If there's no release, we'll just redirect + $release //= {}; + $self->request( '/release/contributors/' . $author . '/' . $release, ) ->cb( sub {