# Cleaning up test files for Paperclipped models

**URL:** <https://www.ruby-forum.com/t/cleaning-up-test-files-for-paperclipped-models/176218>\
**Category:** Rails\
**Created:** [September 26, 2009, 11:52pm UTC](https://www.ruby-forum.com/t/cleaning-up-test-files-for-paperclipped-models/176218 "2009-09-26T23:52:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [September 26, 2009, 11:52pm UTC](https://www.ruby-forum.com/t/cleaning-up-test-files-for-paperclipped-models/176218/1 "2009-09-26T23:52:49Z")

</div>

In my tests that use Paperclip some require that a file is provided, the  
problem is that in the test, when the object gets saved to DB, the  
associated file gets saved to disk and clutters my folders.

So what’s the solution for that? The problem is the has\_attached\_file  
method.
