aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm13
-rw-r--r--t/cobrand/zurich.t11
2 files changed, 20 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index f3cfe8801..0e4c1d907 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -957,10 +957,15 @@ sub admin_report_edit {
# If they clicked the no more updates button, we're done.
if ($c->get_param('no_more_updates')) {
- $problem->set_extra_metadata( subdiv_overdue => $self->overdue( $problem ) );
- $problem->bodies_str( $body->parent->id );
- $problem->whensent( undef );
- $self->set_problem_state($c, $problem, 'feedback pending');
+ if ($problem->non_public) {
+ $problem->bodies_str( $body->parent->id );
+ $self->set_problem_state($c, $problem, 'fixed - council');
+ } else {
+ $problem->set_extra_metadata( subdiv_overdue => $self->overdue( $problem ) );
+ $problem->bodies_str( $body->parent->id );
+ $problem->whensent( undef );
+ $self->set_problem_state($c, $problem, 'feedback pending');
+ }
$problem->update;
$c->res->redirect( '/admin/summary' );
}
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index cab7a3fef..2992a37e7 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -802,7 +802,18 @@ subtest 'test no email sent if closed' => sub {
$mech->email_count_is(0);
};
+subtest 'SDM closing internal report' => sub {
+ $mech->log_in_ok('sdm1@example.org');
+ $internal->update({ bodies_str => $subdivision->id, state => 'confirmed' });
+ $mech->get_ok('/admin/report_edit/' . $internal->id);
+ $mech->submit_form_ok( { form_number => 2, button => 'no_more_updates' } );
+ $internal->discard_changes;
+ is $internal->state, 'fixed - council', 'State updated';
+};
+
subtest 'remove internal flag' => sub {
+ $internal->update({ bodies_str => $subdivision->id, state => 'confirmed' });
+ $mech->get_ok('/admin/report_edit/' . $internal->id);
$mech->submit_form_ok( { form_number => 2, button => 'stop_internal' } );
$internal->discard_changes;
is $internal->non_public, 0;