How do I test a file upload in rails?

后端 未结 7 531
轻奢々
轻奢々 2020-12-07 09:29

I have a controller which is responsible for accepting JSON files and then processing the JSON files to do some user maintenance for our application. In user testing the fil

7条回答
  •  孤街浪徒
    2020-12-07 10:24

    You want to use fixtures_file_upload. You will put your test file in a subdirectory of the fixtures directory and then pass in the path to fixtures_file_upload. Here is an example of code, using fixture file upload

提交回复
热议问题