aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2020-08-21 13:41:20 +0100
committerStruan Donald <struan@exo.org.uk>2020-09-10 10:53:41 +0100
commit4b6baae9c4ac6353357a2f46355aa7eb9c8c10ec (patch)
tree044b0c78660713bfc3c6636d3bfa8cd4dcf0c15d /t
parent7048c1fd5a83714641029ab1d0b22574a64388bd (diff)
[UK] enable extra state mapping in config
Add a cobrand feature that enables a state and external status combination to be mapped to a new display string.
Diffstat (limited to 't')
-rw-r--r--t/cobrand/northamptonshire.t79
1 files changed, 79 insertions, 0 deletions
diff --git a/t/cobrand/northamptonshire.t b/t/cobrand/northamptonshire.t
index 11b22bdb0..5758f700f 100644
--- a/t/cobrand/northamptonshire.t
+++ b/t/cobrand/northamptonshire.t
@@ -114,6 +114,15 @@ subtest 'check further investigation state' => sub {
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);
};
@@ -126,6 +135,76 @@ subtest 'check further investigation state' => sub {
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);
};