Capybara: undefined method 'visit'

后端 未结 6 2109
广开言路
广开言路 2020-12-13 00:25

When running my specs with rspec & capybara, it can\'t find capybara\'s visit method. Is there another initialization step I need to do?

$bundle exec rsp         


        
6条回答
  •  感动是毒
    2020-12-13 01:00

    Unfortunately this workaround doesn't do it for me. I still get

    NoMethodError:
       undefined method `visit' for #
    

    The repo is public under: https://github.com/ikusei/Goldencobra_Newsletter You need to look at the branch '28817499-subscribe'

    edit: If i put include Capybara::DSL inside my describe block it works.

    but including Capybara::DSL in the global scope is not recommended!

    Because I do not know a good way.

提交回复
热议问题