Created
June 4, 2017 17:11
-
-
Save twalpole/bfe3bc6c0376e54b4033fd6e9ed8d10b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'capybara/dsl' | |
require 'capybara/poltergeist' | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:poltergeist, app) | |
sess.visit('/') | |
sess.choose('items_1') | |
__END__ | |
<!doctype html> | |
<html> | |
<body> | |
<h1>Choose</h1> | |
<input type="radio" name="items" id="items_1" value="1" /> first item<br/> | |
<input type="radio" name="items" id="items_2" value="2" /> second item<br/> | |
<input type="radio" name="items" id="items_3" value="3" /> third item<br/> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment