Fix email messages link in admin's user page (#11595)
This commit is contained in:
parent
e2f33a37b7
commit
d49c00aa84
2 changed files with 13 additions and 1 deletions
|
|
@ -25,7 +25,10 @@
|
|||
<h3>Recent Emails</h3>
|
||||
<div class="list-group-flush">
|
||||
<% @user.email_messages.order(sent_at: :desc).limit(50).each do |email| %>
|
||||
<a href="/admin/email_messages/<%= email.id %>" class="list-group-item list-group-item-action">
|
||||
<a href="<%= resource_admin_email_message_path(email.id) %>"
|
||||
class="list-group-item list-group-item-action"
|
||||
rel="noopener noreferer"
|
||||
target="_blank">
|
||||
<%= email.subject %>
|
||||
<em> - <%= email.sent_at&.strftime("%b %e '%y") %></em>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,15 @@ RSpec.describe "admin/users", type: :request do
|
|||
expect(response.body).to include("Current Roles")
|
||||
end
|
||||
end
|
||||
|
||||
context "when a user has been sent an email" do
|
||||
it "renders a link to the user email on the Resource Admin" do
|
||||
email = create(:email_message, user: user, to: user.email)
|
||||
get admin_user_path(user.id)
|
||||
|
||||
expect(response.body).to include(resource_admin_email_message_path(email.id))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET /admin/users/:id/edit" do
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue