How to test Paperclip uploads in Rails4

When testing Paperclip uploads in my application, I’m interested in treating Paperclip as a black box and trusting it for doing its magic. So what I really need to test is that valid files are processed and invalid ones are not. (see How to allow users to crop images in Rails 4 for model and controller code)

Tests for the model:

{[ .model-tests | 1.hljs(=ruby=) ]}

Tests for the controller:

{[ .controller-tests | 1.hljs(=ruby=) ]}


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.