Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Carrierwave + RSpec testing

I'm testing that my file uploads are correct with models with RSpec by setting Model#filename = File.open(etc)

When my specs run, all is grand. But the files still remain in my public/uploads directory after the testsuite finishes.

How do I get the files to delete on the end of running along with the records?

Thanks!

like image 363
Robert Ross Avatar asked Aug 10 '26 17:08

Robert Ross


1 Answers

https://github.com/jnicklas/carrierwave/wiki/How-to:-Cleanup-after-your-Rspec-tests

like image 178
Nash Bridges Avatar answered Aug 13 '26 08:08

Nash Bridges



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!