浏览 2323 次
锁定老帖子 主题:集成测试
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2008-03-17
在试着集成测试时,遇到这样的问题:状态码是422 >> app.class app.class => ActionController::Integration::Session >> app.get"my_services/create" app.get"my_services/create" => 302 >> app.response.redirect_url app.response.redirect_url => "http://www.example.com/login" >> app.post"/login/create",:email_address=>"liwan@126.com",:password=>'123456' app.post"/login/create",:email_address=>"liwan@126.com",:password=>'123456' => 422 >> 查了关于422的状态码,422:Unprocessable Entity:The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions. For example, this error condition may occur if an XML request body contains well-formed (i.e., syntactically correct), but semantically erroneous XML instructions. 可能是请求格式不正确,并不是语法错误!或是请求后转向的不是所需的地方!而是到了其他的地方, 但是还是不明白具体哪地方出错了! 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2008-03-17
没有人知道吗?
|
|
返回顶楼 | |
发表时间:2008-05-05
看一下日志应该可以知道是怎么回事
rails添加了外部表单提交保护功能,没有authenticity_token这个param可能会导致出错 |
|
返回顶楼 | |