diff options
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 1 | ||||
-rw-r--r-- | t/app/controller/report_updates.t | 12 | ||||
-rw-r--r-- | t/open311/getservicerequestupdates.t | 4 | ||||
-rw-r--r-- | templates/web/default/report/updates.html | 10 |
4 files changed, 11 insertions, 16 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index 15a75155a..c30d05b22 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -101,7 +101,6 @@ sub update_comments { $comment->problem_state( 'fixed - council' ); } elsif ( ( $p->is_closed || $p->is_fixed ) and lc($request->{status}) eq 'open' ) { $p->state( 'confirmed' ); - $comment->mark_open(1); $comment->problem_state( 'confirmed' ); } } diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index c601fbbec..82670d6cc 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -580,6 +580,8 @@ for my $test ( # setting it to confirmed shouldn't say anything if ( $test->{fields}->{state} ne 'confirmed' ) { like $update_meta->[0], qr/marked as $test->{fields}->{state}$/, 'update meta includes state change'; + } else { + like $update_meta->[0], qr/reopened$/, 'update meta includes state change'; } like $update_meta->[0], qr{Test User \(Westminster City Council\)}, 'update meta includes council name'; $mech->content_contains( 'Test User (<strong>Westminster City Council</strong>)', 'council name in bold'); @@ -607,14 +609,12 @@ subtest 'check meta correct for comments marked confirmed but not marked open' = $mech->get_ok( "/report/" . $report->id ); my $update_meta = $mech->extract_update_metas; - like $update_meta->[0], qr/marked as open$/, - 'update meta says marked as open'; - unlike $update_meta->[0], qr/reopened$/, + like $update_meta->[0], qr/reopened$/, 'update meta does not say reopened'; - $comment->update( { mark_open => 1 } ); + $comment->update( { mark_open => 1, problem_state => undef } ); $mech->get_ok( "/report/" . $report->id ); - my $update_meta = $mech->extract_update_metas; + $update_meta = $mech->extract_update_metas; unlike $update_meta->[0], qr/marked as open$/, 'update meta does not says marked as open'; @@ -622,7 +622,7 @@ subtest 'check meta correct for comments marked confirmed but not marked open' = $comment->update( { mark_open => 0, problem_state => undef } ); $mech->get_ok( "/report/" . $report->id ); - my $update_meta = $mech->extract_update_metas; + $update_meta = $mech->extract_update_metas; unlike $update_meta->[0], qr/marked as open$/, 'update meta does not says marked as open'; diff --git a/t/open311/getservicerequestupdates.t b/t/open311/getservicerequestupdates.t index e08d2b1e2..7ec8d5ae0 100644 --- a/t/open311/getservicerequestupdates.t +++ b/t/open311/getservicerequestupdates.t @@ -136,7 +136,7 @@ for my $test ( start_state => 'fixed - user', close_comment => 0, mark_fixed => 0, - mark_open => 1, + mark_open => 0, problem_state => 'confirmed', end_state => 'confirmed', }, @@ -148,7 +148,7 @@ for my $test ( start_state => 'closed', close_comment => 0, mark_fixed => 0, - mark_open => 1, + mark_open => 0, problem_state => 'confirmed', end_state => 'confirmed', }, diff --git a/templates/web/default/report/updates.html b/templates/web/default/report/updates.html index 64373b70b..eaf5209ff 100644 --- a/templates/web/default/report/updates.html +++ b/templates/web/default/report/updates.html @@ -22,12 +22,8 @@ [%- ELSE %] [% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_epoch( update.confirmed_local.epoch ) ) | html -%] [%- END -%] - [%- IF update.mark_fixed %] - [%- ", " _ loc( 'marked as fixed' ) %] - [%- ELSE %] - [%- ", " _ loc( 'reopened' ) IF update.mark_open %] - [%- ", " _ tprintf(loc( 'marked as %s' ), update.meta_problem_state) IF update.problem_state AND update.problem_state != 'confirmed' %] - [%- ", " _ loc( 'marked as open' ) IF NOT update.mark_open AND update.problem_state == 'confirmed' %] - [%- END %] + [%- ", " _ loc( 'marked as fixed' ) IF update.mark_fixed %] + [%- ", " _ loc( 'reopened' ) IF update.mark_open OR update.problem_state == 'confirmed' %] + [%- ", " _ tprintf(loc( 'marked as %s' ), update.meta_problem_state) IF update.problem_state AND update.problem_state != 'confirmed' %] [% END %] |