From ab983c0445fde36a5338b199c7d3996580872e7c Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Fri, 7 Aug 2020 17:33:27 +0100 Subject: Enable HTML in updates from staff users This also extends to response templates. --- t/app/controller/questionnaire.t | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 't/app/controller/questionnaire.t') diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t index b561b271a..592507288 100644 --- a/t/app/controller/questionnaire.t +++ b/t/app/controller/questionnaire.t @@ -351,7 +351,7 @@ my $comment = FixMyStreet::DB->resultset('Comment')->find_or_create( user_id => $user->id, name => 'A User', mark_fixed => 'false', - text => 'This is some update text', + text => 'This is some update text', state => 'confirmed', confirmed => $sent_time, anonymous => 'f', @@ -360,7 +360,12 @@ my $comment = FixMyStreet::DB->resultset('Comment')->find_or_create( subtest 'Check updates are shown correctly on questionnaire page' => sub { $mech->get_ok("/Q/" . $token->token); $mech->content_contains( 'Show all updates' ); - $mech->content_contains( 'This is some update text' ); + $mech->content_contains( 'This is some <strong>update</strong> text' ); +}; +subtest 'Check staff update is shown correctly on questionnaire page' => sub { + $comment->update({ extra => { is_superuser => 1 } }); + $mech->get_ok("/Q/" . $token->token); + $mech->content_contains( 'This is some update text' ); }; for my $test ( -- cgit v1.2.3