浏览 1545 次
锁定老帖子 主题:测试代码笔记-RailsSpace
精华帖 (0) :: 良好帖 (0) :: 新手帖 (6) :: 隐藏帖 (2)
|
|
---|---|
作者 | 正文 |
发表时间:2009-03-16
最后修改:2009-03-16
def test_about get :about title = assigns(:title) assert_equal "About RailsSpace", title [color=blue]assert_response :success[/color] assert_template "about" end assert_response :success #判断返回正确,书中的解释为 HTTP uses a numeric code to indicate the response type; the code happens to be 200 for success. You don't have to remember this, though, since Rails lets you use the symbol :success instead. HTTP用数字来指示返回状态,返回成功时代码为200。你不需要记住,因为Rails让你用:success符号来代替 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |