I’m trying to write a test for a model with a picture, using paperclip. I’m using the test framework default, no shoulda or rspec. In this context, how should I test it? Should I really upload a file? How should I add a file to the fixture?
Share
Adding file to a model is dead simple. For example:
In that case you should put the file into your
test/fixturesdir.I usually make a little helper in my test_helper.rb
Then
If you use something like Factory Girl instead of fixtures this becomes even easier.