Why do I get “including Capybara::DSL in the global scope is not recommended!”

前端 未结 1 1674
不知归路
不知归路 2021-02-04 16:41

Everytime I run a spec, even if the spec passes, e.g.

$ rspec spec/integration/view_homepage_spec.rb 
including Capybara::DSL in the global scope is not recommen         


        
相关标签:
1条回答
  • 2021-02-04 17:14

    Because including Capybara::DSL in the global scope is not recommended.

    This includes many methods globally in the system, which could interfere with your own code.

    Here's the correct way:

    RSpec.configure do |config|
      config.include Capybara::DSL, :type => :feature
    end
    
    0 讨论(0)
提交回复
热议问题