Topic: [Rails][Tests] File upload + acts_as_attachement
I just beginning creating tests and I would like to test a file upload and check that a reference to that file has well been added into the database.
I have a model called uploaded_files wich use the acts_as_attachement plugin.
Every uploaded_files belongs to a project.
So in my projects_controller I have a method called upload_file(:project_id, uploaded_file)
old_count = SourceTemplate.count
...#What should I add there ?
assert_equal old_count+1, SourceTemplate.count
If somebody knows how to upload files using acts_as_attachement into test methods, thanks for your help