测试代码笔记-RailsSpace


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符号来代替
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值