From 5f59fa3cd90cdd2ec8970af75316397fde2ae542 Mon Sep 17 00:00:00 2001 From: Chris Mytton Date: Tue, 4 Feb 2025 07:56:12 +0000 Subject: [PATCH] [Bromley] Include flytip information in description --- perllib/FixMyStreet/Cobrand/Bromley.pm | 5 +++++ t/cobrand/bromley.t | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index c869eb85c1..9b3ec2aeb6 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -347,6 +347,11 @@ sub open311_pre_send { $row->detail($text); } } + + if (my $flytip_info = $row->get_extra_field_value('FLY_Q')) { + my $text = $row->detail . "\n\nFlytip information: " . $flytip_info; + $row->detail($text); + } } sub _include_user_title_in_extra { diff --git a/t/cobrand/bromley.t b/t/cobrand/bromley.t index 64e71d85dd..03e9f03f99 100644 --- a/t/cobrand/bromley.t +++ b/t/cobrand/bromley.t @@ -288,6 +288,27 @@ subtest 'Private comments on updates are added to open311 description' => sub { }; }; +subtest 'ensure flytip information is added to open311 description' => sub { + $report->set_extra_fields({ name => 'FLY_Q', value => 'Large sofa and household waste' }); + $report->send_state('unprocessed'); + $report->update; + + FixMyStreet::override_config { + STAGING_FLAGS => { send_reports => 1 }, + ALLOWED_COBRANDS => [ 'fixmystreet', 'bromley' ], + MAPIT_URL => 'http://mapit.uk/', + }, sub { + FixMyStreet::Script::Reports::send(); + }; + + $report->discard_changes; + is $report->send_state, 'sent', 'Report marked as sent'; + + my $req = Open311->test_req_used; + my $c = CGI::Simple->new($req->content); + like $c->param('description'), qr/Flytip information: Large sofa and household waste/, 'flytip information included in description'; +}; + for my $test ( { cobrand => 'bromley',