aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/cobrand/zurich.t30
1 files changed, 19 insertions, 11 deletions
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index fb6f172fe..f6cbeffed 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -617,21 +617,29 @@ subtest "hidden report email are only sent when requested" => sub {
};
subtest "test stats" => sub {
- $user = $mech->log_in_ok( 'super@example.org' );
-
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'zurich' ],
}, sub {
- $mech->get( '/admin/stats' );
+ $user = $mech->log_in_ok( 'super@example.org' );
+
+ $mech->get_ok( '/admin/stats' );
+ is $mech->res->code, 200, "superuser should be able to see stats page";
+
+ $mech->content_contains('Innerhalb eines Arbeitstages moderiert: 2'); # now including hidden
+ $mech->content_contains('Innerhalb von fünf Arbeitstagen abgeschlossen: 3');
+ # my @data = $mech->content =~ /(?:moderiert|abgeschlossen): \d+/g;
+ # diag Dumper(\@data); use Data::Dumper;
+
+ $mech->get_ok( '/admin/stats?export=1' );
+ is $mech->res->code, 200, 'csv retrieved ok';
+ is $mech->content_type, 'text/csv', 'content_type correct' and do {
+ $mech->content_contains(',fixed - council,');
+ $mech->content_contains(',hidden,');
+ my @lines = split /\n/, $mech->content;
+ is scalar @lines, 4, 'Correct number of lines';
+ };
+ $mech->log_out_ok;
};
- is $mech->res->code, 200, "superuser should be able to see stats page";
-
- $mech->content_contains('Innerhalb eines Arbeitstages moderiert: 2'); # now including hidden
- $mech->content_contains('Innerhalb von fünf Arbeitstagen abgeschlossen: 3');
- # my @data = $mech->content =~ /(?:moderiert|abgeschlossen): \d+/g;
- # diag Dumper(\@data); use Data::Dumper;
-
- $mech->log_out_ok;
};
subtest "test admin_log" => sub {