Immediate avatar and embed variants (#2002)

Reverts #2001
Restores #1955
This commit is contained in:
Jorge Manrubia
2025-12-08 23:17:06 +01:00
committed by GitHub
parent f8a812f038
commit cb0e9b9962
10 changed files with 62 additions and 19 deletions
+3 -2
View File
@@ -79,9 +79,10 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
test "update with valid avatar" do
sign_in_as :kevin
png_file = fixture_file_upload("avatar.png", "image/png")
# Create blob separately to ensure file is uploaded before variant processing
blob = ActiveStorage::Blob.create_and_upload!(io: File.open(file_fixture("avatar.png")), filename: "avatar.png", content_type: "image/png")
put user_path(users(:kevin)), params: { user: { avatar: png_file } }
put user_path(users(:kevin)), params: { user: { avatar: blob.signed_id } }
assert_redirected_to user_path(users(:kevin))
assert users(:kevin).reload.avatar.attached?
assert_equal "image/png", users(:kevin).avatar.content_type