`
张云洁
  • 浏览: 10964 次
  • 性别: Icon_minigender_2
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论

集成测试

    博客分类:
  • ruby
阅读更多
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.
可能是请求格式不正确,并不是语法错误!或是请求后转向的不是所需的地方!而是到了其他的地方,
但是还是不明白具体哪地方出错了!
分享到:
评论
2 楼 aotianlong 2008-05-05  
看一下日志应该可以知道是怎么回事
rails添加了外部表单提交保护功能,没有authenticity_token这个param可能会导致出错
1 楼 张云洁 2008-03-17  
没有人知道吗?

相关推荐

Global site tag (gtag.js) - Google Analytics