RSpec have_selector 带有 request 和 request.body
为什么
response.body.should have_selector "result"
通过而
response.should have_selector "result"
不通过?
我知道 ActionController::TestResponse
作为 response
返回,而 response.body
是 String
。
have_selector 只适用于字符串吗?
Why would
response.body.should have_selector "result"
pass and
response.should have_selector "result"
not pass?
I understand ActionController::TestResponse
is returned as the response
and response.body
is a String
.
Does have_selector only work on strings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
response 是整个响应对象,其中包含许多不同的属性。它不是字符串,而 have_selector 测试字符串。
response is the whole response object, which contains lots of different properties. It is not a string, and have_selector tests for a string.