diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 3 | ||||
-rw-r--r-- | perllib/Integrations/Echo.pm | 5 | ||||
-rw-r--r-- | t/cobrand/bromley.t | 39 |
3 files changed, 26 insertions, 21 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index d91570f83..add6ac6bb 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -581,6 +581,9 @@ sub bin_services_for_address { if (!$completed && $row->{last}{date}->ymd eq $now->ymd) { $row->{report_allowed} = 0; } + if ($state eq 'Not Completed' || ($state eq 'Completed' && $resolution eq 'Excess Waste')) { + $row->{report_allowed} = 0; + } } } diff --git a/perllib/Integrations/Echo.pm b/perllib/Integrations/Echo.pm index ec21da8fa..2bd98b777 100644 --- a/perllib/Integrations/Echo.pm +++ b/perllib/Integrations/Echo.pm @@ -100,7 +100,10 @@ sub GetTasks { Ref => { Value => { anyType => [ 234, 567 ] } }, CompletedDate => undef }, - { Ref => { Value => { anyType => [ 345, 678 ] } }, CompletedDate => undef }, + { + Ref => { Value => { anyType => [ 345, 678 ] } }, + State => { Name => 'Not Completed' } + }, { Ref => { Value => { anyType => [ 456, 789 ] } }, CompletedDate => undef }, ] if $self->sample_data; diff --git a/t/cobrand/bromley.t b/t/cobrand/bromley.t index c8683c017..1925a44ca 100644 --- a/t/cobrand/bromley.t +++ b/t/cobrand/bromley.t @@ -261,31 +261,30 @@ subtest 'check heatmap page' => sub { }; }; -subtest 'test open enquiries' => sub { - set_fixed_time('2020-05-19T12:00:00Z'); # After sample food waste collection - FixMyStreet::override_config { - ALLOWED_COBRANDS => 'bromley', - COBRAND_FEATURES => { - echo => { bromley => { sample_data => 1 } }, - waste => { bromley => 1 } - }, - }, sub { +FixMyStreet::override_config { + ALLOWED_COBRANDS => 'bromley', + COBRAND_FEATURES => { + echo => { bromley => { sample_data => 1 } }, + waste => { bromley => 1 } + }, +}, sub { + subtest 'test open enquiries' => sub { + set_fixed_time('2020-05-19T12:00:00Z'); # After sample food waste collection $mech->get_ok('/waste/uprn/12345'); $mech->follow_link_ok({ text => 'Report a problem with a food waste collection' }); $mech->content_contains('Waste spillage'); $mech->content_lacks('Gate not closed'); + restore_time(); }; - restore_time(); -}; -subtest 'test reporting before/after completion' => sub { - FixMyStreet::override_config { - ALLOWED_COBRANDS => 'bromley', - COBRAND_FEATURES => { - echo => { bromley => { sample_data => 1 } }, - waste => { bromley => 1 } - }, - }, sub { + subtest 'test crew reported issue' => sub { + set_fixed_time('2020-05-21T12:00:00Z'); # After sample container mix + $mech->get_ok('/waste/uprn/12345'); + $mech->content_lacks('Report a mixed recycling '); + restore_time(); + }; + + subtest 'test reporting before/after completion' => sub { set_fixed_time('2020-05-27T11:00:00Z'); $mech->get_ok('/waste/uprn/12345'); $mech->content_contains('(completed at 10:00am)'); @@ -301,8 +300,8 @@ subtest 'test reporting before/after completion' => sub { set_fixed_time('2020-05-30T12:00:00Z'); $mech->get_ok('/waste/uprn/12345'); $mech->content_lacks('Report a refuse collection'); + restore_time(); }; - restore_time(); }; subtest 'test waste max-per-day' => sub { |