Immediate avatar and embed variants (#2002)
Reverts #2001 Restores #1955
This commit is contained in:
@@ -27,7 +27,9 @@ class Users::AvatarsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "show own image redirects to the blob url" do
|
||||
users(:david).avatar.attach(io: File.open(file_fixture("moon.jpg")), filename: "moon.jpg", content_type: "image/jpeg")
|
||||
# Create blob separately to ensure file is uploaded before variant processing
|
||||
blob = ActiveStorage::Blob.create_and_upload!(io: File.open(file_fixture("moon.jpg")), filename: "moon.jpg", content_type: "image/jpeg")
|
||||
users(:david).avatar.attach(blob)
|
||||
assert users(:david).avatar.attached?
|
||||
|
||||
get user_avatar_path(users(:david))
|
||||
@@ -36,7 +38,9 @@ class Users::AvatarsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "show other image redirects to the blob url" do
|
||||
users(:kevin).avatar.attach(io: File.open(file_fixture("moon.jpg")), filename: "moon.jpg", content_type: "image/jpeg")
|
||||
# Create blob separately to ensure file is uploaded before variant processing
|
||||
blob = ActiveStorage::Blob.create_and_upload!(io: File.open(file_fixture("moon.jpg")), filename: "moon.jpg", content_type: "image/jpeg")
|
||||
users(:kevin).avatar.attach(blob)
|
||||
assert users(:kevin).avatar.attached?
|
||||
|
||||
get user_avatar_path(users(:kevin))
|
||||
|
||||
Reference in New Issue
Block a user