aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin/stats.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2018-06-07 13:28:45 +0200
committerMarius Halden <marius.h@lden.org>2018-06-07 13:28:45 +0200
commit956f8b8a065824f9a9dc379eba1d0aa8b1b669cf (patch)
tree49f9ccb147b18dddee97500d4df7a3fb3dd3737c /t/app/controller/admin/stats.t
parent782457d016084c8de04989dbc824a71899f8b41b (diff)
parent4dbf5371f79c5f290c08e561ba2c881e96b58669 (diff)
Merge tag 'v2.3.3' into fiksgatami-dev
Diffstat (limited to 't/app/controller/admin/stats.t')
-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();