Here’s small chunk of code that will help you out with testing paperclip. Basically it will stub any fie upload of any instance for given model. So now you won’t be left with ridiculous amount of files created after each test run. Yay!
1 2 3 4 5 6 7 8 9 10 11
Put that file somehere under
spec/support/ and in your
spec_helper.rb include it like using
config.extend PaperclipMacros. Now later in your test (of models or controllers, whatever) you can call it like that:
1 2 3 4