aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand/hackney.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-07-15 16:02:21 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-07-16 14:58:12 +0100
commit88c607fa378951491c7ec0f3384bc8f27fbca467 (patch)
tree3697d45c0ce00625f416c8fc61c0e0cd87fb4cd7 /t/cobrand/hackney.t
parent8a37b57398e09ff13a7370b5119de734ecbc772a (diff)
Fix lookups in templates of categories with &s.
A hash lookup in a template is escaping the key used, meaning the lookup is failing anywhere we are using a category containing an ampersand as a key. A continuation of the changes made in 527d763b.
Diffstat (limited to 't/cobrand/hackney.t')
-rw-r--r--t/cobrand/hackney.t7
1 files changed, 5 insertions, 2 deletions
diff --git a/t/cobrand/hackney.t b/t/cobrand/hackney.t
index b5a629e33..374bf2ea9 100644
--- a/t/cobrand/hackney.t
+++ b/t/cobrand/hackney.t
@@ -28,7 +28,7 @@ my $params = {
my $hackney = $mech->create_body_ok(2508, 'Hackney Council', $params);
my $contact = $mech->create_contact_ok(
body_id => $hackney->id,
- category => 'Potholes',
+ category => 'Potholes & stuff',
email => 'pothole@example.org',
);
$contact->set_extra_fields( ( {
@@ -143,7 +143,7 @@ $p->delete;
subtest "sends branded confirmation emails" => sub {
$mech->log_out_ok;
$mech->clear_emails_ok;
- $mech->get_ok('/around');
+ $mech->get_ok('/?filter_category=Potholes+%26+stuff');
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'hackney' ],
MAPIT_URL => 'http://mapit.uk/',
@@ -159,6 +159,9 @@ subtest "sends branded confirmation emails" => sub {
$mech->submit_form_ok( { with_fields => { pc => 'E8 1DY', } },
"submit location" );
+ # While we're here, check the category with an ampersand (regression test)
+ $mech->content_contains('<option value="Potholes &amp; stuff" selected>');
+
# click through to the report page
$mech->follow_link_ok( { text_regex => qr/skip this step/i, },
"follow 'skip this step' link" );