Skip to content

Commit

Permalink
[Merton] Remove length limit on waste fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Aug 22, 2024
1 parent 361cc2d commit 2db5666
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 2 additions & 0 deletions perllib/FixMyStreet/Cobrand/Merton.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ sub disambiguate_location {
sub report_validation {
my ($self, $report, $errors) = @_;

return if ($report->cobrand_data || '') eq 'waste';

my @extra_fields = @{ $report->get_extra_fields() };

my %max = (
Expand Down
6 changes: 4 additions & 2 deletions t/app/controller/waste_merton.t
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ create_contact({ category => 'Request new container', email => '1635' }, 'Waste'
{ code => 'Container_Type', required => 1, automated => 'hidden_field' },
{ code => 'Action', required => 1, automated => 'hidden_field' },
{ code => 'Reason', required => 1, automated => 'hidden_field' },
{ code => 'Notes', required => 0, automated => 'hidden_field' },
);
create_contact({ category => 'Assisted collection add', email => 'assisted' }, 'Waste',
{ code => 'Crew_Notes', description => 'Notes', required => 1, datatype => 'text' },
Expand Down Expand Up @@ -305,18 +306,19 @@ FixMyStreet::override_config {
$mech->log_in_ok($staff_user->email);
$mech->get_ok('/waste/12345/request');
$mech->submit_form_ok({ with_fields => { 'container-1' => 1, 'quantity-1' => 2 } });
$mech->submit_form_ok({ with_fields => { 'request_reason' => 'new_build', 'request_reason_text' => 'Large household' }});
$mech->submit_form_ok({ with_fields => { 'request_reason' => 'new_build', 'request_reason_text' => 'Large household' x 10 }});
$mech->submit_form_ok({ with_fields => { name => 'Bob Marge', email => $user->email }});
$mech->submit_form_ok({ with_fields => { process => 'summary' } });
$mech->content_contains('request has been sent');
my $report = FixMyStreet::DB->resultset("Problem")->search(undef, { order_by => { -desc => 'id' } })->first;
is $report->get_extra_field_value('uprn'), 1000000002;
is $report->detail, "Quantity: 2\n\n2 Example Street, Merton, KT1 1AA\n\nReason: I am a new resident without a container\n\nAdditional details: Large household";
is $report->detail, "Quantity: 2\n\n2 Example Street, Merton, KT1 1AA\n\nReason: I am a new resident without a container\n\nAdditional details: " . "Large household" x 10;
is $report->title, 'Request new Black rubbish bin (140L)';
FixMyStreet::Script::Reports::send();
my $req = Open311->test_req_used;
my $cgi = CGI::Simple->new($req->content);
is $cgi->param('attribute[Action]'), '1::1';
is $cgi->param('attribute[Notes]'), 'Large household' x 10;
is $cgi->param('attribute[Reason]'), '4::4';
is $cgi->param('attribute[contributed_by]'), $staff_user->email;
$mech->log_out_ok;
Expand Down
8 changes: 2 additions & 6 deletions t/app/controller/waste_merton_bulky.t
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ FixMyStreet::override_config {
'item_3' => '',
},
});
$mech->submit_form_ok({ with_fields => { 'location' => 'location ' x 20, } });
$mech->submit_form_ok; # Location page

$mech->content_contains('Booking Summary');
$mech->content_lacks('You will be redirected to the council’s card payments provider.');
Expand All @@ -631,12 +631,8 @@ FixMyStreet::override_config {
my $new_report;
subtest 'Confirm amendment' => sub {
$mech->submit_form_ok({ with_fields => { tandc => 1 } });
$mech->content_contains('is too long');
$mech->submit_form_ok({ form_number => 3 });
$mech->submit_form_ok({ with_fields => { 'location' => 'in the middle of the drive' } });
$mech->submit_form_ok({ with_fields => { tandc => 1 } });

is $report->comments->search({ state => 'confirmed' })->count, 2; # Confirmation and then cancellation
is $report->comments->count, 2; # Confirmation and then cancellation
FixMyStreet::Script::Alerts::send_updates();
$mech->email_count_is(1); # Cancellation update on original
$mech->clear_emails_ok;
Expand Down

0 comments on commit 2db5666

Please sign in to comment.