2008-03-17

集成测试

关键字: 集成测试问题
Loading development environment (Rails 2.0.1)
在试着集成测试时,遇到这样的问题:状态码是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.
可能是请求格式不正确,并不是语法错误!或是请求后转向的不是所需的地方!而是到了其他的地方,
但是还是不明白具体哪地方出错了!
评论
aotianlong 2008-05-05
看一下日志应该可以知道是怎么回事
rails添加了外部表单提交保护功能,没有authenticity_token这个param可能会导致出错
张云洁 2008-03-17
没有人知道吗?
发表评论

提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则

您还没有登录,请登录后发表评论

张云洁
搜索本博客
最近加入圈子
存档
最新评论