-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Surrey] Disallow email addresses in problem title/detail
- Loading branch information
Showing
6 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,20 @@ FixMyStreet::override_config { | |
$json = $mech->get_ok_json('/around?ajax=1&bbox=-0.45869262976076,51.28481314324,-0.42367370886232,51.302390882532'); | ||
is_deeply($json->{pins}, [], 'Borough problem is excluded from Surrey cobrand'); | ||
}; | ||
|
||
subtest 'Get error when email included in report' => sub { | ||
$mech->get_ok('/report/new?longitude=-0.441269&latitude=51.293415'); | ||
$mech->submit_form_ok({ with_fields => { category => 'Potholes', title => 'Potholes', detail => 'On main road', name => 'Bob Betts', username_register => '[email protected]' } }); | ||
$mech->content_contains('Click the link in our confirmation email to publish your problem', 'Detail field without email proceeds normally'); | ||
$mech->get_ok('/report/new?longitude=-0.441269&latitude=51.293415'); | ||
$mech->submit_form_ok({ with_fields => { category => 'Potholes', title => 'Potholes', detail => 'On main road. Contact me at [email protected]', name => 'Bob Betts', username_register => '[email protected]' } }); | ||
$mech->content_contains("<p class='form-error'>Please remove any email addresses and other personal information from your report", "Report detail with email gives error"); | ||
$mech->get_ok('/report/new?longitude=-0.441269&latitude=51.293415'); | ||
$mech->submit_form_ok({ with_fields => { category => 'Potholes', title => 'Potholes contact me [email protected]', detail => 'On main road', name => 'Bob Betts', username_register => '[email protected]' } }); | ||
$mech->content_contains("<p class='form-error'>Please remove any email addresses and other personal information from your report", "Report title with email gives error"); | ||
$mech->clear_emails_ok; | ||
}; | ||
|
||
}; | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
[% PROCESS 'footer_extra_js_base.html' highways=1 validation=1 %] | ||
[% scripts.push( | ||
version('/cobrands/surrey/js.js'), | ||
) %] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(function(){ | ||
if (!window.translation_strings) { | ||
return; | ||
} | ||
|
||
// Surrey want custom error messages when an email address is present | ||
translation_strings.detail.notEmail = 'Report cannot contain an email address or personal information'; | ||
translation_strings.title.notEmail = 'Report cannot contain an email address or personal information'; | ||
|
||
})(); |