ruby on rails - How to assert the value of an input element with assert_select -


given html in view:

<form id="new_merchant_user" method="post">   <fieldset>     <div id='legend'>        <legend>recover pasword</legend>      </div>      <input id="merchant_user_email" name="merchant_user[email]" type="text" value="" />      <input class="btn btn-success" name="commit" type="submit" value="send reset instructions" />     </fieldset> </form> 

how select value of button assert_select? try

assert_select 'form input[type=submit]', "send reset instructions" 

but failing

<send reset instructions> expected <>.. expected 0 >= 1. 

basically, selecting nothing.

what doing wrong here?

in case use:

assert_select 'form input[type=submit][value=send reset instructions]' 

as value attribute not text within html tag.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -