diff options
Diffstat (limited to 't/app/controller/about.t')
-rw-r--r-- | t/app/controller/about.t | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/t/app/controller/about.t b/t/app/controller/about.t index 4e49cdac9..cec50abfa 100644 --- a/t/app/controller/about.t +++ b/t/app/controller/about.t @@ -1,3 +1,4 @@ +use utf8; use strict; use warnings; @@ -7,25 +8,26 @@ use Test::WWW::Mechanize::Catalyst 'FixMyStreet::App'; ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' ); # check that we can get the page -$mech->get_ok('/about'); -$mech->content_like(qr{About us ::\s+FixMyStreet}); +$mech->get_ok('/faq'); +$mech->content_like(qr{Frequently Asked Questions ::\s+FixMyStreet}); $mech->content_contains('html class="no-js" lang="en-gb"'); -SKIP: { - skip( "Need 'emptyhomes' in ALLOWED_COBRANDS config", 8 ) - unless FixMyStreet::Cobrand->exists('emptyhomes'); +$mech->get_ok('/privacy'); +is $mech->res->code, 200, "got 200 for final destination"; +is $mech->res->previous->code, 302, "got 302 for redirect"; +is $mech->uri->path, '/about/privacy'; - # check that geting the page as EHA produces a different page - ok $mech->host("reportemptyhomes.co.uk"), 'change host to reportemptyhomes'; - $mech->get_ok('/about'); - $mech->content_like(qr{About us ::\s+Report Empty Homes}); - $mech->content_contains('html lang="en-gb"'); +$mech->get('/about/page-that-does-not-exist'); +ok !$mech->res->is_success(), "want a bad response"; +is $mech->res->code, 404, "got 404"; - # check that geting the page as EHA in welsh produces a different page - ok $mech->host("cy.reportemptyhomes.co.uk"), 'host to cy.reportemptyhomes'; - $mech->get_ok('/about'); - $mech->content_like(qr{Amdanom ni ::\s+Adrodd am Eiddo Gwag}); - $mech->content_contains('html lang="cy"'); -} +FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'fiksgatami' ], +}, sub { + ok $mech->host("www.fiksgatami.no"), 'host to fiksgatami'; + $mech->get_ok('/faq'); + $mech->content_like(qr{Ofte spurte spørsmål ::}); + $mech->content_contains('html class="no-js" lang="nb"'); +}; done_testing(); |