have_tag与Have_selector

| 我已经成功地将have_selector与RSpec(版本2.0.1)一起使用了。我最近在与RSpec 1.3.2关联的have_tag ... with_tag ...文档中找到了文档,并希望使用它,但是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 \”。     
已邀请:
        花了我一段时间才能在文档中找到它,但是正确的答案是
  response.should have_selector(\"div.breadcrumbs select\") do |content|
    content.should have_selector(:option, :value => @brands.name)
    content.should have_selector(:option, :value => @marketsize.name)
  end
    
           RSpec-2将不包含have_tag。改用webrat \的have_selector匹配器。 http://groups.google.com/group/rspec/browse_thread/thread/1c254524d6859ba9     

要回复问题请先登录注册