Testing file upload is not working

I am trying to test file upload but when I am doing:


post ‘some_path’, params: { file: Rack::Test::UploadedFile.new(…) }

I get in controller file as string “Rack::Test::UploadedFile:123123123”, so I can’t pass files in controller spec.

Does anyone know how to do it right? I think I am missing something.

Screenshot from 2021-06-03 12-46-28