2008-03-17
集成测试
关键字: 集成测试问题
Loading development environment (Rails 2.0.1)
在试着集成测试时,遇到这样的问题:状态码是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.
可能是请求格式不正确,并不是语法错误!或是请求后转向的不是所需的地方!而是到了其他的地方,
但是还是不明白具体哪地方出错了!
在试着集成测试时,遇到这样的问题:状态码是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可能会导致出错
rails添加了外部表单提交保护功能,没有authenticity_token这个param可能会导致出错
张云洁
2008-03-17
没有人知道吗?
发表评论
提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则
- 浏览: 1330 次
- 性别:

- 来自: 上海

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
关于if xx.save的问题
不是有很多高手吗?怎么没人解答啊,也得照顾照顾我们这些小虾吧!郁闷!
-- by 张云洁 -
关于if xx.save的问题
请大家看以下!
-- by 张云洁 -
集成测试
看一下日志应该可以知道是怎么回事rails添加了外部表单提交保护功能,没有aut ...
-- by aotianlong -
路由测试问题
assert_generates("/members/regist",pts) ...
-- by aotianlong -
集成测试
没有人知道吗?
-- by 张云洁






评论排行榜