Open Haegin opened 1 year ago
Hi @Haegin Have you tried ApolloUploadServer::Wrappers::UploadedFile.new(UploadTestHelper.generic_file)?
@fuelen yes, that's still not considered a valid upload.
FYI doing this explicitly fixed our tests @fuelen @Haegin :
ApolloUploadServer::Wrappers::UploadedFile.new(Rack::Test::UploadedFile.new(Rails.public_path.join('image/logo.png')))
I'm in the process of upgrading an app from 2.0.1 to 2.1.5 and all the tests we have involving uploaded files are now failing with an "# is not a valid upload" error. In our tests we're creating these files using a helper method:
and then we're using it anywhere we need a file in the tests:
This was working as expected until now, but after upgrading to 2.1.5 these test files are being rejected. I can't see any documentation on how to create test files. I've tracked down the issue to this change - https://github.com/jetruby/apollo_upload_server-ruby/pull/32/files. Is it possible to get an example of how to use this Wrappers::UploadedFile class to wrap up a local file for specs please? I've tried a few things and haven't managed to get anything working.