0
我最近从RSpec
切换到Minitest
。我的模型测试都运行良好。但是,我的集成测试不再有效。have_content和have_selector不能与水豚和Minitest
我没有拨打have_content
或have_selector
正在工作。
我已经包含Capybara::DSL
在我test_helper.rb
文件如下:
class ActionDispatch::IntegrationTest
include Rails.application.routes.url_helpers # for x_path and x_url helpers
include Capybara::DSL
include PossibleJSDriver # switching Capybara driver for javascript tests
def setup
end
end
下面是测试中的违规行:
page.should have_selector('ul.ui-autocomplete li.ui-menu-item a')
和错误:
NoMethodError: undefined method `have_selector' for #<AppIntegrationTest:0x007f95f103afc8>
我不不明白为什么这些不再工作。我正在使用minitest-rails-capybara
宝石。