13 Nov '13, 11am

Avoid using fixture_file_upload with FactoryGirl and Paperclip via @pivotallabs

Joe Moore and I are using FactoryGirl and Paperclip for file attachments. The factory for building our Attachment model looked like this: factory :attachment do supporting_documentation { fixture_file_upload('test.pdf', 'application/pdf') } # ... end Yesterday our test suite began raising the following error: Failure/Error: let(:attachment) { FactoryGirl.create(:attachment) } Errno::EMFILE: Too many open files - /var/folders/3q/_15370v96jlbnxsk3whsks5c0000gn/T/test20120920-4004-7c2o9y.pdf It turns out that Rails’ fixture_file_upload method does not close the temporary file it creates. We found a suggestion to prevent leaking file handles by adding an after_create block that manually closes the file. We tested this fix by looping through the model spec 1000 times. More tests passed, but it eventually blew up with the same error. Using fixture_file_upload needlessly exercise...

Full article: http://pivotallabs.com/avoid-using-fixture-file-upload-wi...

Tweets

FactoryGirl for Seed Data?

robots.thoughtbot.com 14 Nov '13, 1am

The default attributes of a factory may change over time. This means that, when you're using FactoryGirl to generate data ...

jasmineってpivotalだったんだ / “Pivotal Tools - Pivota...

pivotallabs.com 13 Nov '13, 12am

Project Monitor is a Ruby-on-Rails–based information radiator that collects continuous integration (CI) status and other m...

We've added more ways to Search in Tracker for ...

pivotallabs.com 14 Nov '13, 9pm

Jo's been testing and helping deliver quality software for a couple of decades – with much of that spent successfully lead...