Capybara testing value of hidden field

capybara

I have a form with a hidden field that contains the current date.

I'm trying to figure out how to write a capybara finder to:

  1. Check that the field is there
  2. Check the value of the field

Is this possible with Capybara?

Best Answer

just do this:

find("#id_of_hidden_input", :visible => false).value