I want to test uploading a file in a Rails Rspec request test. I\'m using Paperclip for asset storage.
I\'ve tried:
path = \'path/to/fixture_file\'
para
For rails 6 no need to do includes, just fixture_file_upload
. If you are using spec/fixtures/files
folder for fixtures you can use file_fixture
helper
let(:csv_file) { fixture_file_upload(file_fixture('file_example.csv')) }
subject(:http_request) { post upload_file_path, params: { file: csv_file } }