【问题标题】:Using rspec with Webrat instead of Capybara将 rspec 与 Webrat 一起使用,而不是 Capybara
【发布时间】:2010-10-22 07:39:53
【问题描述】:

我一直在使用带有 webrat 的 rspec,并决定添加 cucumber 进行高级测试。

在用 capybara 安装 cucumber 后,由于某种原因 rspec 也转而使用它。

有没有办法告诉 rspec 继续使用 webrat ?

【问题讨论】:

    标签: ruby-on-rails rspec webrat capybara


    【解决方案1】:

    确保您的 Gemfile 中同时包含 webrat 和 capybara,并将以下内容添加到您的 /spec/spec_helper.rb:

    require "webrat"
    Webrat.configure do |config|
        config.mode = :rails
    end
    

    我刚刚切换到 capybara,但我的视图规范停止工作,因为 capybara 没有“have_selector”。猜你有类似的问题,好吧,现在它(希望)解决了。

    【讨论】:

      猜你喜欢
      • 2014-07-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多