aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/cobrand/northamptonshire.t55
-rw-r--r--templates/web/base/report/_update_state.html4
2 files changed, 47 insertions, 12 deletions
diff --git a/t/cobrand/northamptonshire.t b/t/cobrand/northamptonshire.t
index 766922c4a..36a2c4638 100644
--- a/t/cobrand/northamptonshire.t
+++ b/t/cobrand/northamptonshire.t
@@ -52,7 +52,7 @@ $ncc->update( { comment_user_id => $counciluser->id } );
subtest 'Check district categories hidden on cobrand' => sub {
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { northamptonshire => '.' } ],
+ ALLOWED_COBRANDS=> 'northamptonshire',
MAPIT_URL => 'http://mapit.uk/',
}, sub {
$mech->get_ok( '/around' );
@@ -70,7 +70,7 @@ subtest 'Check district categories hidden on cobrand' => sub {
subtest 'Check updates not sent for defects' => sub {
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { northamptonshire => '.' } ],
+ ALLOWED_COBRANDS=> 'northamptonshire',
MAPIT_URL => 'http://mapit.uk/',
}, sub {
my $updates = Open311::PostServiceRequestUpdates->new();
@@ -86,7 +86,7 @@ $report->update({ user => $user });
$comment->update({ extra => undef });
subtest 'check updates sent for non defects' => sub {
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { northamptonshire => '.' } ],
+ ALLOWED_COBRANDS=> 'northamptonshire',
MAPIT_URL => 'http://mapit.uk/',
}, sub {
my $updates = Open311::PostServiceRequestUpdates->new();
@@ -112,7 +112,7 @@ subtest 'check further investigation state' => sub {
$comment->update();
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { northamptonshire => '.' } ],
+ ALLOWED_COBRANDS=> 'northamptonshire',
MAPIT_URL => 'http://mapit.uk/',
COBRAND_FEATURES => {
extra_state_mapping => {
@@ -133,7 +133,7 @@ subtest 'check further investigation state' => sub {
$comment->update;
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { northamptonshire => '.' } ],
+ ALLOWED_COBRANDS=> 'northamptonshire',
MAPIT_URL => 'http://mapit.uk/',
COBRAND_FEATURES => {
extra_state_mapping => {
@@ -151,7 +151,7 @@ subtest 'check further investigation state' => sub {
$mech->content_contains('Under further investigation');
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { northamptonshire => '.' } ],
+ ALLOWED_COBRANDS=> 'northamptonshire',
MAPIT_URL => 'http://mapit.uk/',
COBRAND_FEATURES => {
extra_state_mapping => {
@@ -177,7 +177,7 @@ subtest 'check further investigation state' => sub {
$mech->content_lacks('Under further investigation');
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { northamptonshire => '.' } ],
+ ALLOWED_COBRANDS=> 'northamptonshire',
MAPIT_URL => 'http://mapit.uk/',
}, sub {
$mech->get_ok('/report/' . $comment->problem_id);
@@ -187,7 +187,7 @@ subtest 'check further investigation state' => sub {
$mech->content_lacks('Under further investigation');
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { fixmystreet => '.' } ],
+ ALLOWED_COBRANDS=> 'fixmystreet',
MAPIT_URL => 'http://mapit.uk/',
COBRAND_FEATURES => {
extra_state_mapping => {
@@ -212,7 +212,7 @@ subtest 'check further investigation state' => sub {
$mech->content_contains('Under further investigation');
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { fixmystreet => '.' } ],
+ ALLOWED_COBRANDS=> 'fixmystreet',
MAPIT_URL => 'http://mapit.uk/',
COBRAND_FEATURES => {
extra_state_mapping => {
@@ -238,7 +238,7 @@ subtest 'check further investigation state' => sub {
$mech->content_lacks('Under further investigation');
FixMyStreet::override_config {
- ALLOWED_COBRANDS => [ { fixmystreet => '.' } ],
+ ALLOWED_COBRANDS=> 'fixmystreet',
MAPIT_URL => 'http://mapit.uk/',
}, sub {
$mech->get_ok('/report/' . $comment->problem_id);
@@ -246,6 +246,41 @@ subtest 'check further investigation state' => sub {
$mech->content_contains('Investigating');
$mech->content_lacks('Under further investigation');
+
+ $comment->set_extra_metadata('external_status_code' => '');
+ $comment->update;
+ my $comment2 = FixMyStreet::DB->resultset('Comment')->create( {
+ mark_fixed => 0,
+ user => $user,
+ problem => $report,
+ anonymous => 0,
+ text => 'this is a comment',
+ confirmed => DateTime->now,
+ state => 'confirmed',
+ problem_state => 'investigating',
+ cobrand => 'default',
+ } );
+ $comment2->set_extra_metadata('external_status_code' => 'further');
+ $comment2->update;
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS=> 'northamptonshire',
+ MAPIT_URL => 'http://mapit.uk/',
+ COBRAND_FEATURES => {
+ extra_state_mapping => {
+ northamptonshire => {
+ investigating => {
+ further => 'Under further investigation'
+ }
+ }
+ }
+ }
+ }, sub {
+ $mech->get_ok('/report/' . $comment->problem_id);
+ };
+
+ $mech->content_contains('Investigating');
+ $mech->content_contains('Under further investigation');
};
subtest 'check pin colour / reference shown' => sub {
diff --git a/templates/web/base/report/_update_state.html b/templates/web/base/report/_update_state.html
index 0bc4bfb52..ecac68850 100644
--- a/templates/web/base/report/_update_state.html
+++ b/templates/web/base/report/_update_state.html
@@ -1,6 +1,6 @@
[% # Small chance of duplicates in the case of fixed - user followed by fixed - council %]
-[% SET update_state = update.problem_state %]
-[% IF ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state == 'confirmed') )
+[% SET update_state = update.problem_state_processed %]
+[% IF ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state_processed == 'confirmed') )
OR update.mark_fixed
OR update.mark_open
%]