aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand/northamptonshire.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
committerMarius Halden <marius.h@lden.org>2021-10-07 13:32:40 +0200
commit09dacfc6b8bf62addeee16c20b1d90c2a256da96 (patch)
tree7caa2bf9e92227ab74448f9b746dd28bbcb81b2a /t/cobrand/northamptonshire.t
parent585e57484f9c6332668bf1ac0a6a3b39dbe32223 (diff)
parentcea89fb87a96943708a1db0f646492fbfaaf000f (diff)
Merge tag 'v3.1' into fiksgatami-devfiksgatami-dev
Diffstat (limited to 't/cobrand/northamptonshire.t')
-rw-r--r--t/cobrand/northamptonshire.t182
1 files changed, 179 insertions, 3 deletions
diff --git a/t/cobrand/northamptonshire.t b/t/cobrand/northamptonshire.t
index 57fe319a9..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();
@@ -107,6 +107,182 @@ subtest 'check updates disallowed correctly' => sub {
is $cobrand->updates_disallowed($report), 1;
};
+subtest 'check further investigation state' => sub {
+ $comment->problem_state('investigating');
+ $comment->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_lacks('Under further investigation');
+
+ $comment->set_extra_metadata('external_status_code' => 'further');
+ $comment->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('Under further investigation');
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS=> 'northamptonshire',
+ MAPIT_URL => 'http://mapit.uk/',
+ COBRAND_FEATURES => {
+ extra_state_mapping => {
+ northamptonshire => {
+ fixed => {
+ further => 'Under further investigation'
+ }
+ },
+ fixmystreet => {
+ 'Northamptonshire County Council' => {
+ fixed => {
+ further => 'Under further investigation'
+ }
+ }
+ }
+ }
+ }
+ }, sub {
+ $mech->get_ok('/report/' . $comment->problem_id);
+ };
+
+ $mech->content_contains('Investigating');
+ $mech->content_lacks('Under further investigation');
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS=> 'northamptonshire',
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok('/report/' . $comment->problem_id);
+ };
+
+ $mech->content_contains('Investigating');
+ $mech->content_lacks('Under further investigation');
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS=> 'fixmystreet',
+ MAPIT_URL => 'http://mapit.uk/',
+ COBRAND_FEATURES => {
+ extra_state_mapping => {
+ northamptonshire => {
+ investigating => {
+ further => 'Under further investigation'
+ }
+ },
+ fixmystreet => {
+ 'Northamptonshire County Council' => {
+ investigating => {
+ further => 'Under further investigation'
+ }
+ }
+ }
+ }
+ }
+ }, sub {
+ $mech->get_ok('/report/' . $comment->problem_id);
+ };
+
+ $mech->content_contains('Under further investigation');
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS=> 'fixmystreet',
+ MAPIT_URL => 'http://mapit.uk/',
+ COBRAND_FEATURES => {
+ extra_state_mapping => {
+ northamptonshire => {
+ fixed => {
+ further => 'Under further investigation'
+ }
+ },
+ fixmystreet => {
+ 'Northamptonshire County Council' => {
+ fixed => {
+ further => 'Under further investigation'
+ }
+ }
+ }
+ }
+ }
+ }, sub {
+ $mech->get_ok('/report/' . $comment->problem_id);
+ };
+
+ $mech->content_contains('Investigating');
+ $mech->content_lacks('Under further investigation');
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS=> 'fixmystreet',
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok('/report/' . $comment->problem_id);
+ };
+
+ $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 {
FixMyStreet::override_config {
ALLOWED_COBRANDS => 'northamptonshire',