aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/about.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-07-07 22:28:21 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-07-14 14:22:24 +0100
commit6f23d7b44ddc2556897e920cb88a3c81357605bf (patch)
tree48be64c12f96048a5df42888f34b0ada91d98a69 /t/app/controller/about.t
parent863e8b2d548d95b89da068bd3361ce8131f77f55 (diff)
Allow static home page template override.
If an /about/homepage.html template exists in your cobrand, it will be used as the front page, and the normal front page will be available at /report.
Diffstat (limited to 't/app/controller/about.t')
-rw-r--r--t/app/controller/about.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/app/controller/about.t b/t/app/controller/about.t
index 8f3f25e27..04d902bc5 100644
--- a/t/app/controller/about.t
+++ b/t/app/controller/about.t
@@ -1,3 +1,9 @@
+package FixMyStreet::Cobrand::Tester;
+use parent 'FixMyStreet::Cobrand::Default';
+sub path_to_web_templates { [ FixMyStreet->path_to( 't', 'app', 'controller', 'templates') ] }
+
+package main;
+
use FixMyStreet::TestMech;
ok( my $mech = FixMyStreet::TestMech->new, 'Created mech object' );
@@ -25,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();