开发者

How to test file upload to webservice in Cucumber-Rails

开发者 https://www.devze.com 2023-01-19 11:24 出处:网络
Hi 开发者_开发知识库Given I have a webservice which accepts file uploads. And I want to test it in Cucumber

Hi

开发者_开发知识库Given I have a webservice which accepts file uploads.

And I want to test it in Cucumber

When I put the following code in Step Definition

post '/webservice', 'picture[file]' => File.new(Rails.root.join(@path_to_file), 'rb')

Then I should see the saved file

Unfortunately, this is not the case.

Any help would be greatly appreciated.


Sorry, I should be using fixture_file_upload.
How do I test a file upload in rails?

0

精彩评论

暂无评论...
验证码 换一张
取 消