Rails/ spec fill_in using placeholder

Viewed 6185

In my rspec test, how do I fill_in a text field using Placeholder. I cannot use id and name as they are auto generated for the nested form.

<input class="input-medium inline" id="user_kids_attributes_new_1342116887461_first_name" name="user[kids_attributes][new_1342116887461][first_name]" placeholder="First Name" size="30" type="text">

Thanks

3 Answers

'Card number' being the placeholder

This should work, EXCEPT you're trying to fill an input inside an iframe

In that case: https://stackoverflow.com/a/53227758/1248725

fill_in('Card number', with: "#{arg1} #{arg2} #{arg3} #{arg4}")

This

Related