From 2a6e538e9486f35af7eb1f287e3ec858ab83f8cd Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 26 Oct 2015 16:05:24 +0000 Subject: Add generic static route handler. This puts all static pages under /about, and lets you add new static pages by placing new HTML in your about template directory. --- t/app/controller/about.t | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 't/app/controller') diff --git a/t/app/controller/about.t b/t/app/controller/about.t index fb0744d6a..750983f24 100644 --- a/t/app/controller/about.t +++ b/t/app/controller/about.t @@ -11,6 +11,15 @@ $mech->get_ok('/about'); $mech->content_like(qr{About us ::\s+FixMyStreet}); $mech->content_contains('html class="no-js" lang="en-gb"'); +$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'; + +$mech->get('/about/page-that-does-not-exist'); +ok !$mech->res->is_success(), "want a bad response"; +is $mech->res->code, 404, "got 404"; + FixMyStreet::override_config { ALLOWED_COBRANDS => [ 'emptyhomes' ], }, sub { -- cgit v1.2.3