Presign_endpoint(:cache) for test env

I can not find in the documentation if it is possible and how to have a presign_endpoint for an test env where we are testing. It should be something dummy I guess, not a real call to aws endpoint.

Is there an article or some information on how to do this?


I tracked it down to

=> 150:         data = storage.presign(location, **options)
   151:       end
   153:       { fields: {}, headers: {} }.merge(data.to_h)
   154:     end
(byebug) storage
#<Shrine::Storage::Memory:0x0000556a94d65340 @store={}>

The memory storage is asked for a presign location. It has an undefined method “.presign”

Update 2:
I guess I should use minio to make sure the file is uploaded.

You have two options for testing that would be fairly easy to set up:

  1. use MinIO, which is effectively a local AWS S3 (here are some instructions)
  2. use upload_endpoint for testing instead of presign_endpoint

Option :two: would require you to have additional JS code that’s only used for testing, so it’s a trade-off. In the HTML you could write the information whether Uppy should use AWS S3 or XHR Upload plugin, the official demo application is doing something like this.

Thanks. I kind of tried this two options and one other but it got complex and I abandoned it for now.