I’m writing a simple test to check that a form is loading the correct values.
I’ve looked through the docs and can’t seem to find an example that shows how to verify the value of a form input.
I have a form that renders the first_name of a user.
I just want to use assert_select on the text input and verify that the first_name field matches what’s in the database exactly (e.g users(:one).first_name)
How does one do this in Rails?
Actually the
assert_tagis deprecated.There’s a good example of how to do this with
assert_selectin the documentation, so you could do this: