aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2015-04-21 14:18:17 +0000
committerDave Arter <davea@mysociety.org>2015-10-06 09:09:25 +0100
commit91da8077bad2de594297c13c507cc5001c036531 (patch)
treefa50791ea9019bd4624876a56f2ade26fd9439e4 /t/cobrand
parent3ef919ee67fc34c8b06dd85b035ba9d0ef85804c (diff)
[Zurich] Tweaks to redirect
See mysociety/FixMyStreet-Commercial#690 I understand redirection to summary page was introduced at ZWN's request, to make it easy to process reports and then quickly move onto the next one. However, during testing now, Tobias has mentioned this is a) slowing things down and b) confusing because it's not obvious that the report has been saved. I've tried to address (b) by adding the "Aktualisiert!" message when you are redirected. Also, for (a) I've removed the redirection from a few cases, and disabled it for superuser. If need be, I can remove redirection from more (or all) cases. Fix Official answer/Reply to user - hide label for status update on state change - correct wording on button for closure (single wording) - correct wording on label for user reply (either "Official answer" or "Reply to user" as appropriate) - Make sure the official response texts are shown for edit/static as appropriate, and test. - javascript improvements - honour public status update for Extern/Wunsch too - don't show public message for Wunsch - Ignore all other fields when rotating photos. (See mysociety/FixMyStreet-Commercial#718)
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/zurich.t38
1 files changed, 37 insertions, 1 deletions
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index 0a622cb2b..a8a1d973e 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -782,7 +782,7 @@ subtest "test stats" => sub {
$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 eines Arbeitstages moderiert: 3');
$mech->content_contains('Innerhalb von f&uuml;nf Arbeitstagen abgeschlossen: 3');
# my @data = $mech->content =~ /(?:moderiert|abgeschlossen): \d+/g;
# diag Dumper(\@data); use Data::Dumper;
@@ -854,6 +854,42 @@ subtest 'email images to external partners' => sub {
};
};
+subtest 'Status update shown as appropriate' => sub {
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'zurich' ],
+ }, sub {
+ # ALL closed states must hide the public_response edit, and public ones
+ # must show the answer in blue.
+ for (['planned', 1, 0],
+ ['fixed - council', 0, 1],
+ ['closed', 0, 1],
+ ['hidden', 0, 0])
+ {
+ my ($state, $update, $public) = @$_;
+ $report->update({ state => $state });
+ $mech->get_ok( '/admin/report_edit/' . $report->id );
+ contains_or_lacks($mech, $update, "<textarea name='status_update'");
+ contains_or_lacks($mech, $public, '<div class="admin-official-answer">');
+
+ if ($public) {
+ $mech->get_ok( '/report/' . $report->id );
+ $mech->content_contains('Antwort</h4>');
+ }
+ }
+ };
+};
+
+# TODO refactor into FixMyStreet::TestMech;
+sub contains_or_lacks {
+ my ($mech, $contains, $text) = @_;
+ if ($contains) {
+ $mech->content_contains($text);
+ }
+ else {
+ $mech->content_lacks($text);
+ }
+}
+
subtest 'time_spent' => sub {
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'zurich' ],