aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-03-20 17:46:15 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-03-21 14:34:39 +0000
commit129de99f4c042cf9f9cb4a25cc3f5bb5c40077c3 (patch)
tree06b6719072832e3b14d3b760f3c9d3809511f4dd /t/app
parentbe61e9162a225323e5840227980b45cc16cdd497 (diff)
[fixmystreet.com] Add admin page to list refused.
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/admin/stats.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/app/controller/admin/stats.t b/t/app/controller/admin/stats.t
index dae51d31f..ce6f8466c 100644
--- a/t/app/controller/admin/stats.t
+++ b/t/app/controller/admin/stats.t
@@ -9,4 +9,30 @@ subtest "smoke view some stats pages" => sub {
$mech->get_ok('/admin/stats/questionnaire');
};
+subtest "test refused stats page works" => sub {
+ my $body1 = $mech->create_body_ok(2651, 'Edinburgh Council');
+ my $body2 = $mech->create_body_ok(2237, 'Oxfordshire Council', { send_method => 'Refused' });
+ my $body3 = $mech->create_body_ok(2243, 'Warwickshire Council', { can_be_devolved => 1 });
+ $mech->create_contact_ok(body_id => $body1->id, category => 'Street lighting', email => 'REFUSED');
+ $mech->create_contact_ok(body_id => $body1->id, category => 'Potholes', email => 'potholes@example.org');
+ $mech->create_contact_ok(body_id => $body2->id, category => 'Potholes', email => 'potholes@example.org');
+ $mech->create_contact_ok(body_id => $body3->id, category => 'Street lighting', email => 'lights@example.org');
+ $mech->create_contact_ok(body_id => $body3->id, category => 'Potholes', email => 'potholes@example.org', send_method => 'Refused');
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ { fixmystreet => '.' } ],
+ }, sub {
+ $mech->get_ok('/admin/stats/refused');
+ };
+ $mech->content =~ /class="content"(.*)class="nav-wrapper/s;
+ my @lines = split /<li>/, $1;
+ is @lines, 7;
+ like $lines[1], qr/Edinburgh/;
+ like $lines[2], qr/Street lighting/;
+ like $lines[3], qr/Oxfordshire/;
+ like $lines[4], qr/ALL/;
+ like $lines[5], qr/Warwickshire/;
+ like $lines[6], qr/Potholes/;
+};
+
done_testing();