【问题标题】:no such file to load -- action_controller/integration - NoMethodError for Rails 3 and Webrat没有要加载的文件——action_controller/integration——Rails 3 和 Webrat 的 NoMethodError
【发布时间】:2011-12-01 04:53:09
【问题描述】:

我在 RSpec 测试期间遇到以下故障..

no such file to load -- action_controller/integration

..使用 Rails 3、RSpec 2 和 Webrat,如果我按以下方式包含 Webrat 助手(想法是使用 Webrat 来处理 have_taghave_selector 方法,而不是 assert_select)。

RSpec.configure do |config|
  ..
  config.include Webrat::HaveTagMatcher
end

但显然Webrat and Rails 3 are not compatible 还没有。一种解决方案是避免使用 Webrat gem 并改用 assert_select。有没有人更好的解决方案?如何避免错误?

【问题讨论】:

    标签: ruby-on-rails-3 rspec2 webrat


    【解决方案1】:

    我还没有找到解决这个问题的方法,只能解决。至少在 RSpec 请求测试中,您可以使用 Capybara 的 have_selector 方法而不是 Webrat。 RSpec2 and Capybara 有一定的困难(page.should have_selector 只在你使用 Capybara 的 'visit' 方法时有效,而不是 RSpec 方法 get '/some/path'),但基本上它是有效的。

    【讨论】:

      猜你喜欢
      • 2011-03-28
      • 2011-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-02
      相关资源
      最近更新 更多