Help to understand why Capybara finds the email address field regardless of value visible.
There is a page with a field on the form:
<input type="email" name="email" class="hide" placeholder="Email">
This is the class .hide
display: none !important;
When I test the page using Capybara with the Poltergeist driver, then do a very simple check:
page.must_have_field('email', :type => 'email', :visible => false)
check('Send by email')
page.must_have_field('email', :type => 'email', :visible => true)
Now the test passes, despite the fact that the code to toggle the visibility field is missing, i.e. it is always hidden.