Skip to content

Commit

Permalink
[Bromley] Include flytip information in description
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismytton committed Feb 5, 2025
1 parent 61e7964 commit 5f59fa3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions perllib/FixMyStreet/Cobrand/Bromley.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Check warning on line 353 in perllib/FixMyStreet/Cobrand/Bromley.pm

View check run for this annotation

Codecov / codecov/patch

perllib/FixMyStreet/Cobrand/Bromley.pm#L352-L353

Added lines #L352 - L353 were not covered by tests
}
}

sub _include_user_title_in_extra {
Expand Down
21 changes: 21 additions & 0 deletions t/cobrand/bromley.t
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 5f59fa3

Please sign in to comment.