diff --git a/app/views/admin/activity/show.html.erb b/app/views/admin/activity/show.html.erb index 01d2623e7..878f69e3a 100644 --- a/app/views/admin/activity/show.html.erb +++ b/app/views/admin/activity/show.html.erb @@ -42,7 +42,7 @@ <% else %> <%= activity.actionable.title %>
- <%= activity.actionable.description %> + <%= sanitize(activity.actionable.description) %> <% end %> <%= activity.user.name %> (<%= activity.user.email %>) diff --git a/spec/system/admin/activity_spec.rb b/spec/system/admin/activity_spec.rb index 7ee48afe0..42beefa16 100644 --- a/spec/system/admin/activity_spec.rb +++ b/spec/system/admin/activity_spec.rb @@ -9,7 +9,7 @@ describe "Admin activity" do context "Proposals" do scenario "Shows moderation activity on proposals" do - proposal = create(:proposal) + proposal = create(:proposal, description: "

Description with html tag

") visit proposal_path(proposal) @@ -24,6 +24,7 @@ describe "Admin activity" do expect(page).to have_content(proposal.title) expect(page).to have_content("Hidden") expect(page).to have_content(admin.user.username) + expect(page).to have_css("p", exact_text: "Description with html tag") end end