【发布时间】:2011-06-15 18:26:41
【问题描述】:
我已经成功地将 have_selector 与 RSpec(版本 2.0.1)一起使用。我最近发现了关于 have_tag ... with_tag ... 与 RSpec 1.3.2 相关的文档并想使用它,但 RSpec 给了我错误:
undefined method `has_tag?' for #<ActionController::TestResponse:0x105584e80>
在以下几行:
response.should have_tag("div.breadcrumbs select") do
with_tag(:option, :value => @brands.name)
with_tag(:option, :value => @marketsize.name)
end
我尝试使用相同的语法将“have_selector”和“with_selector”替换为“have_tag”和“with_tag”,在这种情况下我会收到错误消息
undefined method `with_selector' for #<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_1::Nested_1:0x105379de8>
我也尝试过不使用“with_tag”,而用“have_selector”替换,但没有成功。
【问题讨论】: