diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2015-10-26 16:05:24 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2015-10-29 17:59:45 +0000 |
commit | 2a6e538e9486f35af7eb1f287e3ec858ab83f8cd (patch) | |
tree | 0369a6fb0fa06bcb206735a4d3881a16e8540b28 /t/app/controller | |
parent | 783eb401e5074c908d2d80862efff4f81c73eb74 (diff) |
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.
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/about.t | 9 |
1 files changed, 9 insertions, 0 deletions
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 { |