简体   繁体   English

功能测试中的请求格式

[英]Request format in functional tests

How do I set the request format in a functional test? 如何在功能测试中设置请求格式?

I'm trying to do something like: 我正在尝试做类似的事情:

get :show, :id => '1', :format => :xml

but that doesn't work. 但这不起作用。

由于某种原因,您不能使用符号来定义测试中的格式,您必须使用字符串版本。

get :show, :id => '1', :format => 'xml'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM