diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-22 11:14:54 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-23 13:45:54 +0100 |
commit | 6150cdcb32474102370a4be4d730ca55c1a74e7e (patch) | |
tree | abe6bef0b6803fdf592793a3a312d1b91bb579d7 /t/app/model/responsepriority.t | |
parent | 1c8249e4b9a7199cad448de3eeb8e1c6b0fb7f1f (diff) |
Escape data attributes in template.
This fixes a bug whereby a double quote in an item would not be JSON-escaped
due to being HTML-escaped first, meaning it would not parse as JSON on the
client.
Diffstat (limited to 't/app/model/responsepriority.t')
-rw-r--r-- | t/app/model/responsepriority.t | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/t/app/model/responsepriority.t b/t/app/model/responsepriority.t index 03c5bccae..4e624bf07 100644 --- a/t/app/model/responsepriority.t +++ b/t/app/model/responsepriority.t @@ -78,24 +78,6 @@ subtest 'by_categories returns all response priorities for an area with multiple is scalar @$traffic_lights, 2, 'Traffic lights have 2 defect types'; }; -subtest 'by_categories encodes HTML entities' => sub { - FixMyStreet::App->model('DB::ResponsePriority')->find_or_create( - { - body_id => $other_body->id, - name => 'This priority\'s name has an apostrophe', - description => 'This priority is for all categories' - } - ); - - my @contacts = FixMyStreet::DB->resultset('Contact')->not_deleted->search( { body_id => [ $oxfordshire->id ] } )->all; - my $priorities = FixMyStreet::App->model('DB::ResponsePriority')->by_categories($area_id, @contacts); - - my $traffic_lights = decode_json($priorities->{'Traffic lights'}); - use Data::Dumper; - my $priority = @$traffic_lights[2]; - is $priority->{name}, 'This priority's name has an apostrophe'; -}; - END { $mech->delete_body( $other_body ); $mech->delete_body( $oxfordshire ); |