简体   繁体   中英

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'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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