How to upload a file in a Rails Rspec request spec

前端 未结 5 2215
没有蜡笔的小新
没有蜡笔的小新 2021-02-19 03:20

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         


        
5条回答
  •  别跟我提以往
    2021-02-19 03:35

    Might be useful for other users: I got this problem because I mistakenly used a get instead of a post request in my specs.

提交回复
热议问题