[Ruby] Error when using rails capybara

less than 1 minute read

For the purpose of this time, like 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’ve put together a helpful link for each error. For the rough setting, refer 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 in capybara, the above error seems to occur unless it is set.

Failure/Error: fill_in'email', with: user.email
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 in your browser.