Skip to content

Commit

Permalink
Set canonical URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
benmwebb committed Sep 11, 2015
1 parent ff38121 commit 5123dd2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/frontend/frontend.pl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ BEGIN

# Test start_html method
{
my $self = {CGI=>new CGI, page_title=>'test page title'};
my $self = {CGI=>new CGI, page_title=>'test page title',
canonical_url=>'/foo'};
bless($self, 'saliweb::frontend');
like($self->start_html(),
'/<!DOCTYPE html.*<head>.*<title>test page title<\/title>' .
Expand All @@ -101,7 +102,8 @@ BEGIN

# Test start_html method with modified header
{
my $self = {CGI=>new CGI, page_title=>'test page title'};
my $self = {CGI=>new CGI, page_title=>'test page title',
canonical_url=>'/foo'};
bless($self, 'Dummy::StartHTMLFrontend');
like($self->start_html(),
'/type="text\/css" href="\/saliweb\/css\/server\.css".*' .
Expand Down Expand Up @@ -427,7 +429,8 @@ END

sub make_test_frontend {
my $self = {CGI=>new CGI, page_title=>'test title',
rate_limit_checked=>0, server_name=>shift, cgiroot=>'/foo'};
rate_limit_checked=>0, server_name=>shift, cgiroot=>'/foo',
canonical_url=>'/foo'};
bless($self, 'Dummy::Frontend');
return $self;
}
Expand Down Expand Up @@ -562,7 +565,7 @@ sub test_display_page {

# Test format_user_error method
{
my $self = {CGI=>new CGI};
my $self = {CGI=>new CGI, canonical_url=>'/foo'};
bless($self, 'saliweb::frontend');
my $exc = new saliweb::frontend::InputValidationError("my inpvalid error");
like($self->format_user_error($exc),
Expand All @@ -574,7 +577,7 @@ sub test_display_page {

# Test handle_user_error method
{
my $self = {CGI=>new CGI, page_title=>'testtitle'};
my $self = {CGI=>new CGI, page_title=>'testtitle', canonical_url=>'/foo'};
bless($self, 'saliweb::frontend');
my $exc = new saliweb::frontend::InputValidationError("my inpvalid error");
my $out = stdout_from { $self->handle_user_error($exc) };
Expand Down

0 comments on commit 5123dd2

Please sign in to comment.