File Coverage

blib/lib/App/AutoCRUD/View/Redirect.pm
Criterion Covered Total %
statement 20 20 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 0 1 0.0
total 27 28 96.4


line stmt bran cond sub pod time code
1             package App::AutoCRUD::View::Redirect;
2              
3 1     1   565 use 5.010;
  1         4  
4 1     1   7 use strict;
  1         3  
  1         43  
5 1     1   6 use warnings;
  1         2  
  1         32  
6              
7 1     1   6 use Moose;
  1         2  
  1         9  
8             extends 'App::AutoCRUD::View';
9 1     1   7811 use App::AutoCRUD::View::TT; # for its utf8_url() filter
  1         2  
  1         43  
10              
11 1     1   20 use namespace::clean -except => 'meta';
  1         3  
  1         10  
12              
13              
14             sub render {
15 2     2 0 10 my ($self, $url, $context) = @_;
16              
17             # make sure the URL is url-encoded with utf8 chars
18 2         12 $url = App::AutoCRUD::View::TT::utf8_url($url);
19              
20             # SEE_OTHER http code (cf http://en.wikipedia.org/wiki/303_See_Other)
21 2         895 return [303, [Location => $url], []];
22             }
23              
24             1;
25              
26              
27             __END__
28              
29              
30