aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/app/controller/about.t24
-rw-r--r--t/app/controller/report_display.t5
-rw-r--r--t/app/controller/templates/about/homepage.html3
3 files changed, 27 insertions, 5 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();
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t
index bcdf612be..093ea9cf8 100644
--- a/t/app/controller/report_display.t
+++ b/t/app/controller/report_display.t
@@ -35,11 +35,6 @@ subtest "check that no id redirects to homepage" => sub {
is $mech->uri->path, '/', "at home page";
};
-subtest "test id=NNN redirects to /NNN" => sub {
- $mech->get_ok("/report?id=$report_id");
- is $mech->uri->path, "/report/$report_id", "at /report/$report_id";
-};
-
subtest "test bad council email clients web links" => sub {
$mech->get_ok("/report/3D$report_id");
is $mech->uri->path, "/report/$report_id", "at /report/$report_id";
diff --git a/t/app/controller/templates/about/homepage.html b/t/app/controller/templates/about/homepage.html
new file mode 100644
index 000000000..c8d5c1eb3
--- /dev/null
+++ b/t/app/controller/templates/about/homepage.html
@@ -0,0 +1,3 @@
+<p>
+ THIS IS A STATIC FRONT PAGE.
+</p>