否定assert_difference?
我正在做功能测试,刚刚发现了assert_difference,如:
assert_difference('Account.count') do
post :create, :account => @account.attributes
end
是否有一个对应项,可以检查Account.count是否没有更改?
I am doing functional tests and just discovered assert_difference, as in:
assert_difference('Account.count') do
post :create, :account => @account.attributes
end
Is there a counterpart, which would check if Account.count has not changed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自文档:“断言计算表达式的数值结果是在调用传入块之前和之后没有改变。”
From the docs: "Assertion that the numeric result of evaluating an expression is not changed before and after invoking the passed in block."