Undefined webrat methods in cucumber step_definitions

前端 未结 3 645
说谎
说谎 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.

提交回复
热议问题