I am having some very strange behaviour with Capybara. It stubbornly refuses to fill in the fields of my login form.
The locator for find
and fill_in
are different:
The string "#user_email" represents a css-selector. This is why it works in find
but not fill_in
.
For fill_in
to work, you need to just pass in the id value - ie just "user_email".
within("#login_form"){ fill_in("user_email", with: "foo@example.com")}