Skip to content

Commit 09f8525

Browse files
committed
[Surrey] Disable reCAPTCHA
1 parent d674546 commit 09f8525

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

perllib/FixMyStreet/Cobrand/Surrey.pm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ sub enter_postcode_text { 'Enter a nearby UK postcode, or street name and area'
6666
sub cut_off_date { '2024-09-16' }
6767

6868

69+
=item * requires_recaptcha
70+
71+
Disable reCAPTCHA on this cobrand because we never see end users' IPs, only
72+
those of the Imperva WAF, some of which are considered non-UK.
73+
74+
=cut
75+
76+
sub requires_recaptcha { 0 }
77+
78+
6979
=head2 problems_restriction/problems_sql_restriction/problems_on_map_restriction
7080
7181
Reports made on FMS.com before the cut off date are not shown on the Surrey cobrand;

t/app/controller/contact.t

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,32 @@ subtest 'recaptcha' => sub {
710710
$mech->content_contains('Thank you for your enquiry');
711711
};
712712
};
713+
714+
subtest 'Surrey never shows reCAPTCHA' => sub {
715+
FixMyStreet::override_config {
716+
ALLOWED_COBRANDS => 'surrey',
717+
RECAPTCHA => { secret => 'secret', site_key => 'site_key' },
718+
} => sub {
719+
$mech->create_body_ok(
720+
2242, 'Surrey County Council',
721+
{ cobrand => 'surrey' },
722+
);
723+
ok $mech->host('tellus.surreycc.gov.uk');
724+
725+
$mod_app->mock( 'user_country', sub {'GB'} );
726+
727+
$mech->get_ok('/contact');
728+
$mech->content_contains('Surrey County Council');
729+
$mech->content_lacks('g-recaptcha');
730+
731+
$mod_app->mock( 'user_country', sub {'FR'} );
732+
733+
$mech->get_ok('/contact');
734+
$mech->content_lacks('g-recaptcha');
735+
$mech->submit_form_ok( { with_fields => \%common } );
736+
$mech->content_contains('Thank you for your enquiry');
737+
};
738+
};
713739
};
714740

715741
done_testing();

0 commit comments

Comments
 (0)