Skip to content

Commit

Permalink
Suppression de l’ancien layout flash
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoineGirard committed Dec 24, 2024
1 parent 592d58d commit 874ee8e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
8 changes: 0 additions & 8 deletions app/views/layouts/_flash.html.slim

This file was deleted.

6 changes: 3 additions & 3 deletions spec/views/flash_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
RSpec.describe "layouts/_flash", type: :view do
RSpec.describe "layouts/_flash_dsfr", type: :view do
it "sanitizes JS out of links" do
notice = <<~HTML
<a href="javascript:alert('hi');">Cliquez ici</a>
HTML
render(partial: "layouts/flash", locals: { flash: { notice: notice } })
render(partial: "layouts/flash_dsfr", locals: { flash: { notice: notice } })
expect(rendered).to include("<a>Cliquez ici</a>")
end

Expand All @@ -28,7 +28,7 @@
<em>Less important</em>
HTML

render(partial: "layouts/flash", locals: { flash: { notice: notice } })
render(partial: "layouts/flash_dsfr", locals: { flash: { notice: notice } })
expect(rendered.squish).to include(expected_output.squish)
end
end

0 comments on commit 874ee8e

Please sign in to comment.