diff options
author | Marius Halden <marius.h@lden.org> | 2017-11-03 16:13:59 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2017-11-03 16:13:59 +0100 |
commit | 42d874db498d0fabae92d0c87acf99054d92391b (patch) | |
tree | d0cf5afdee3d244c4e5da6fe1ab9acba620634df /t/app/controller/about.t | |
parent | 19a7c5dda85a47a68040c742791e9cd9d3e52be6 (diff) | |
parent | dc7613329c275cd158fdde8faf1c0e301f5b7202 (diff) |
Merge tag 'v2.2' into fiksgatami-dev
Diffstat (limited to 't/app/controller/about.t')
-rw-r--r-- | t/app/controller/about.t | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/t/app/controller/about.t b/t/app/controller/about.t index cec50abfa..04d902bc5 100644 --- a/t/app/controller/about.t +++ b/t/app/controller/about.t @@ -1,11 +1,12 @@ -use utf8; -use strict; -use warnings; +package FixMyStreet::Cobrand::Tester; +use parent 'FixMyStreet::Cobrand::Default'; +sub path_to_web_templates { [ FixMyStreet->path_to( 't', 'app', 'controller', 'templates') ] } -use Test::More; -use Test::WWW::Mechanize::Catalyst 'FixMyStreet::App'; +package main; -ok( my $mech = Test::WWW::Mechanize::Catalyst->new, 'Created mech object' ); +use FixMyStreet::TestMech; + +ok( my $mech = FixMyStreet::TestMech->new, 'Created mech object' ); # check that we can get the page $mech->get_ok('/faq'); @@ -30,4 +31,22 @@ FixMyStreet::override_config { $mech->content_contains('html class="no-js" lang="nb"'); }; +$mech->get_ok('/'); +$mech->content_contains('Report a problem'); +$mech->content_lacks('STATIC FRONT PAGE'); +$mech->get('/report'); +is $mech->res->code, 200, "got 200"; +is $mech->res->previous->code, 302, "got 302 for redirect"; +is $mech->uri->path, '/', 'redirected to front page'; + +FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'tester' ], +}, sub { + $mech->get_ok('/'); + $mech->content_contains('STATIC FRONT PAGE'); + $mech->get_ok('/report'); + is $mech->res->previous, undef, 'No redirect'; + $mech->content_contains('Report a problem'); +}; + done_testing(); |