【问题标题】:RSpec have_selector with request and request.bodyRSpec have_selector 与 request 和 request.body
【发布时间】:2011-07-10 01:16:47
【问题描述】:

为什么会

response.body.should have_selector "result"

通过和

response.should have_selector "result"

不通过?

我知道ActionController::TestResponse 被返回为responseresponse.bodyString

have_selector 只对字符串起作用吗?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 rspec rspec2 capybara


    【解决方案1】:

    response 是整个响应对象,它包含许多不同的属性。它不是一个字符串,而 have_selector 测试一个字符串。

    【讨论】:

    • 我就是这么想的。只是验证一下,因为这是从 have_tag 移动到 have_selector 时出现的问题。 ]
    猜你喜欢
    • 2015-09-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-25
    相关资源
    最近更新 更多