Skip to content

Instantly share code, notes, and snippets.

@paulsturgess
Last active December 14, 2015 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulsturgess/5143646 to your computer and use it in GitHub Desktop.
Save paulsturgess/5143646 to your computer and use it in GitHub Desktop.
Useful capybara checks

Check a download

page.response_headers['Content-Type'].should == "text/csv"
page.response_headers['Content-Disposition'].should == "attachment; filename=\"some_file.csv\""

Check link href

find("a.some_link")["href"].should == "http://google.com"

Manually set the value of a field (even if it is a hidden field) with the following:

find("#your_field_id").set "malicious_value"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment