Posts

Showing posts from December, 2013

Capybara cheat sheet

=Navigating= visit('/projects') visit(post_comments_path(post)) =Clicking links and buttons= click_link('id-of-link') click_link('Link Text') click_button('Save') click('Link Text') # Click either a link or a button click('Button Value') =Interacting with forms= fill_in('First Name', :with => 'John') fill_in('Password', :with => 'Seekrit') fill_in('Description', :with => 'Really Long Text…') choose('A Radio Button') check('A Checkbox') uncheck('A Checkbox') attach_file('Image', '/path/to/image.jpg') select('Option', :from => 'Select Box') =scoping= within("//li[@id='employee']") do fill_in 'Name', :with => 'Jimmy' end within(:css, "li#employee") do fill_in 'Name', :with => 'Jim