For the purpose of this time, as in the following reference article, It was to be able to use the sign_in method when running the rspec test. https://qiita.com/jnchito/items/a8360e5e7a829d1e19b2
Therefore, when I tried to set capybara with rails, I got the following error I'll put a reference link for each error. Also, for the rough settings, I referred to the following article. https://qiita.com/morrr/items/0e24251c049180218db4
undefined method `visit'
https://qiita.com/terufumi1122/items/aefd6c965e9e946efc3b Since visit is a method that can be used with capybara, it seems that the above error will occur unless it is set.
Failure/Error: fill_in 'email', with: user.email
Capybara::ElementNotFound:
Unable to find field "email" that is not disabled
https://qiita.com/pooooon/items/4fbc429d07e4b65ed928
In my case, I made the following changes and the error disappeared.
fill_in 'user[email]', with: user.email
fill_in 'user[password]', with: 'password'
As mentioned in the article, there are some patterns that are not'session [email]', so you should check them properly with a browser.
Recommended Posts