Rails functional test assert_select form input value?
Checkbox: If you want to assert_select a checked checkbox (in this case 1 checked checkbox), try this:
assert_select 'input[type=checkbox][checked]', 1
Not 100% related to the question, but more for documentation purpose for others.
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