File Coverage

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


line stmt bran cond sub pod time code
1             package App::AutoCRUD::View::Redirect;
2              
3 1     1   488 use 5.010;
  1         2  
  1         39  
4 1     1   4 use strict;
  1         1  
  1         32  
5 1     1   6 use warnings;
  1         1  
  1         30  
6              
7 1     1   4 use Moose;
  1         2  
  1         7  
8             extends 'App::AutoCRUD::View';
9 1     1   4761 use App::AutoCRUD::View::TT; # for its utf8_url() filter
  1         2  
  1         30  
10              
11 1     1   4 use namespace::clean -except => 'meta';
  1         1  
  1         8  
12              
13              
14             sub render {
15 2     2 0 5 my ($self, $url, $context) = @_;
16              
17             # make sure the URL is url-encoded with utf8 chars
18 2         10 $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         532 return [303, [Location => $url], []];
22             }
23              
24             1;
25              
26              
27             __END__
28              
29              
30