From dc677127a3a635b5c43196cddb003632c0daa32a Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Fri, 14 Feb 2025 10:44:48 +0000 Subject: [PATCH] fixup! [Bexley][WW] Cancel GGW subscription MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Send tomorrow’s date when cancelling --- perllib/FixMyStreet/Cobrand/Bexley/Garden.pm | 2 +- t/app/controller/waste_bexley_garden.t | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/perllib/FixMyStreet/Cobrand/Bexley/Garden.pm b/perllib/FixMyStreet/Cobrand/Bexley/Garden.pm index c766fa8bd2..31a4e4b9dc 100644 --- a/perllib/FixMyStreet/Cobrand/Bexley/Garden.pm +++ b/perllib/FixMyStreet/Cobrand/Bexley/Garden.pm @@ -91,7 +91,7 @@ sub waste_garden_sub_params { my $srv = $self->garden_current_subscription; my $parser = DateTime::Format::Strptime->new( pattern => '%d/%m/%Y' ); - my $due_date_str = $parser->format_datetime( $srv->{end_date} ); + my $due_date_str = $parser->format_datetime( DateTime->now->add(days => 1) ); my $reason = $data->{reason}; $reason .= ': ' . $data->{reason_further_details} diff --git a/t/app/controller/waste_bexley_garden.t b/t/app/controller/waste_bexley_garden.t index 2f4b12bcbb..799851f6bf 100644 --- a/t/app/controller/waste_bexley_garden.t +++ b/t/app/controller/waste_bexley_garden.t @@ -342,6 +342,7 @@ FixMyStreet::override_config { subtest 'cancel garden subscription' => sub { set_fixed_time('2024-02-01T00:00:00'); + my $tomorrow = DateTime::Format::Strptime->new( pattern => '%d/%m/%Y' )->format_datetime( DateTime->now->add(days => 1) ); $agile_mock->mock( 'CustomerSearch', sub { { Customers => [ @@ -383,7 +384,7 @@ FixMyStreet::override_config { is $report->get_extra_field_value('customer_external_ref'), 'CUSTOMER_123'; is $report->get_extra_field_value('due_date'), - '12/12/2025'; + $tomorrow; is $report->get_extra_field_value('reason'), 'Other: Burnt all my leaves'; @@ -437,7 +438,7 @@ FixMyStreet::override_config { is $report->get_extra_field_value('customer_external_ref'), 'CUSTOMER_123'; is $report->get_extra_field_value('due_date'), - '12/12/2025'; + $tomorrow; is $report->get_extra_field_value('reason'), 'Other: Burnt all my leaves';