Rails functional test assert_select form input value?
ruby-on-rails, ruby-on-rails-3
Solution
Actually the `assert_tag` is deprecated.
There's a good example of how to do this with `assert_select` in the documentation, so you could do this:
assert_select '#user_first_name' do
assert_select "[value=?]", Users.first.first_name
end
Problem
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?