Rails Rspec error - undefined method `visit'

后端 未结 2 1060
太阳男子
太阳男子 2020-12-10 05:31

So I\'m new to TDD & I\'m throwing some Rspec errors here on my tests...Basically after running bundle exec rspec spec, I get an undefined method \'visit\'

2条回答
  •  失恋的感觉
    2020-12-10 06:09

    The problem is here:

    ./spec/requests/user_pages_spec.rb
    

    You put the Capybara integration tests in requests folder. That's why the method visit won't work.

    To fix, just move all the tests from spec/requests to spec/features.

提交回复
热议问题