Rspec, Devise, Factory girl - how to sign in Factory user through Rspec controller test?

≡放荡痞女 提交于 2019-12-05 05:12:23

I highly recommend removing your controller tests and using Cucumber stories instead -- RSpec is not as convenient for testing user-facing stuff as Cucumber is.

In Cucumber, you'd want to log in through the UI to mimic exactly what the user will do. I would tend to do the same thing in a controller spec, though some people might prefer mocking things out instead.

As for undefined method password_salt=, did you migrate your test DB?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!