akanshmurthy / railsbridge-testfest

The skeleton app.
MIT License
4 stars 2 forks source link

Cloudinary Input in Post Controller Spec #21

Closed camachom closed 7 years ago

camachom commented 7 years ago
# post_controller_spec.rb line 126
file_io = fixture_file_upload 'files/bridgetroll.svg', 'image/svg'

file_io is a Tempfile which is then passed into params[:post][:image]. In this case, the Cloudinary API requires a path to a file, so no matter what students do in the post_controller, they won't be able to successfully make the API call.

Cloudinary::Uploader.upload(file, options = {})

I could easily fix this on line 127 by using (file_io.path) instead of the Tempfile itself. Also, by the recommendation of the docs, Tempfiles should be explicitly garbage collected by using #unlink.

akanshmurthy commented 7 years ago

Awesome, good catch! CC: @schaui6 @siruguri