Add sanitize to description on moderator activity
Currently html tags were being displayed in the description. We used the sanitize method to not display them.
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
<% else %>
|
<% else %>
|
||||||
<strong><%= activity.actionable.title %></strong>
|
<strong><%= activity.actionable.title %></strong>
|
||||||
<br>
|
<br>
|
||||||
<%= activity.actionable.description %>
|
<%= sanitize(activity.actionable.description) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td class="align-top">
|
<td class="align-top">
|
||||||
<%= activity.user.name %> (<%= activity.user.email %>)
|
<%= activity.user.name %> (<%= activity.user.email %>)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ describe "Admin activity" do
|
|||||||
|
|
||||||
context "Proposals" do
|
context "Proposals" do
|
||||||
scenario "Shows moderation activity on proposals" do
|
scenario "Shows moderation activity on proposals" do
|
||||||
proposal = create(:proposal)
|
proposal = create(:proposal, description: "<p>Description with html tag</p>")
|
||||||
|
|
||||||
visit proposal_path(proposal)
|
visit proposal_path(proposal)
|
||||||
|
|
||||||
@@ -24,6 +24,7 @@ describe "Admin activity" do
|
|||||||
expect(page).to have_content(proposal.title)
|
expect(page).to have_content(proposal.title)
|
||||||
expect(page).to have_content("Hidden")
|
expect(page).to have_content("Hidden")
|
||||||
expect(page).to have_content(admin.user.username)
|
expect(page).to have_content(admin.user.username)
|
||||||
|
expect(page).to have_css("p", exact_text: "Description with html tag")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user