Undefined webrat methods in cucumber step_definitions

前端 未结 3 644
说谎
说谎 2021-02-15 02:47

When i run my features i get this error:

undefined method `visit\' for # (NoMethodError)

This is the r

相关标签:
3条回答
  • 2021-02-15 03:00

    I had to set config.mode to :rack instead of :rails:

    # […]
    require 'webrat'
    require 'webrat/core/matchers'
    
    Webrat.configure do |config|
      config.mode = :rack
      config.open_error_files = false # Set to true if you want error pages to pop up in the browser
    end
    # […]
    

    now works as expected.

    0 讨论(0)
  • 2021-02-15 03:17

    Paul Nelligan try adding this to env.rb to fix the error : "no such file to load -- action_controller/integration"

    World(Webrat::Methods)
    World(Webrat::Matchers)
    
    0 讨论(0)
  • 2021-02-15 03:27

    I also encountered this error on two separate occasions: the first instance the adjustment to confg.mode solved the problem; the second time, however, after a lot of frustration I found a link that suggested a buggy version of bundler could be the culprit. Updating it solved the problem.

    0 讨论(0)
提交回复
热议问题