Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capybara: How do I fill in a input field by its ID

Tags:

rspec

capybara

I have this:

<input class="string optional"      id="course_group_courses_attributes_2_name"      name="course_group[courses_attributes][2][name]"      placeholder="Lengua"      size="15"      type="text" /> </div>  

How do I fill in a that field by its ID?

like image 339
Nerian Avatar asked Jan 21 '11 00:01

Nerian


1 Answers

fill_in accepts the id as first parameter:

fill_in 'course_group_courses_attributes_2_name', :with => 'some text' 
like image 97
raidfive Avatar answered Sep 22 '22 21:09

raidfive