Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/views/layouts/solid_errors/_style.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<style nonce="<%= content_security_policy_nonce %>">
<style<% if local_assigns[:nonce] %> nonce="<%= nonce %>"<% end %>>
/*
! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com
*/
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/solid_errors/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<%= render "layouts/solid_errors/style" %>
<%= render "layouts/solid_errors/style", nonce: content_security_policy_nonce %>
</head>
<body class="h-full flex flex-col pb-4">
<main class="grow container mx-auto mt-4">
Expand Down
19 changes: 19 additions & 0 deletions test/mailers/solid_errors/error_mailer_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require "test_helper"

class SolidErrors::ErrorMailerTest < ActionMailer::TestCase
test "the error email renders its html part" do
report_raised_error("oof")

email = SolidErrors::ErrorMailer.error_occurred(SolidErrors::Occurrence.last)

assert_includes email.html_part.body.to_s, "oof"
end

private

def report_raised_error(message)
raise StandardError, message
rescue => error
Rails.error.report(error)
end
end
Loading