Immediate avatar and embed variants
Process variants synchronously on attachment to close the window between image upload and variant availability, guaranteeing that we won't have lazy variant processing attempts in GET requests. Tradeoff is that we do variant processing in upload requests, which is actually desirable. We're working with images that should take milliseconds to resize given that we'll already have the file on hand. References https://github.com/rails/rails/pull/51951
This commit is contained in:
@@ -22,11 +22,12 @@ class Notification::BundleMailerTest < ActionMailer::TestCase
|
||||
end
|
||||
|
||||
test "renders avatar with external image URL when avatar is attached" do
|
||||
@user.avatar.attach(
|
||||
blob = ActiveStorage::Blob.create_and_upload!(
|
||||
io: File.open(Rails.root.join("test", "fixtures", "files", "avatar.png")),
|
||||
filename: "avatar.png",
|
||||
content_type: "image/png"
|
||||
)
|
||||
@user.avatar.attach(blob)
|
||||
|
||||
create_notification(@user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user