diff options
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 6 | ||||
-rw-r--r-- | t/open311/getservicerequestupdates.t | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index bb3583e38..c30d05b22 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -98,12 +98,10 @@ sub update_comments { if ( $comment->created_local > $p->lastupdate_local ) { if ( $p->is_open and lc($request->{status}) eq 'closed' ) { $p->state( 'fixed - council' ); - - $comment->mark_fixed( 1 ); + $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/open311/getservicerequestupdates.t b/t/open311/getservicerequestupdates.t index 92d03e385..7ec8d5ae0 100644 --- a/t/open311/getservicerequestupdates.t +++ b/t/open311/getservicerequestupdates.t @@ -113,6 +113,7 @@ for my $test ( close_comment => 0, mark_fixed=> 0, mark_open => 0, + problem_state => undef, end_state => 'confirmed', }, { @@ -122,8 +123,9 @@ for my $test ( external_id => 638344, start_state => 'confirmed', close_comment => 1, - mark_fixed=> 1, + mark_fixed=> 0, mark_open => 0, + problem_state => 'fixed - council', end_state => 'fixed - council', }, { @@ -134,7 +136,8 @@ 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', }, { @@ -145,7 +148,8 @@ for my $test ( start_state => 'closed', close_comment => 0, mark_fixed => 0, - mark_open => 1, + mark_open => 0, + problem_state => 'confirmed', end_state => 'confirmed', }, { @@ -185,6 +189,7 @@ for my $test ( ok $c, 'comment exists'; is $c->text, $test->{description}, 'text correct'; is $c->mark_fixed, $test->{mark_fixed}, 'mark_closed correct'; + is $c->problem_state, $test->{problem_state}, 'problem_state correct'; is $c->mark_open, $test->{mark_open}, 'mark_open correct'; is $problem->state, $test->{end_state}, 'correct problem state'; }; |