Skip to content

Instantly share code, notes, and snippets.

@wktk
Created December 22, 2012 07:00
Show Gist options
  • Save wktk/4357812 to your computer and use it in GitHub Desktop.
Save wktk/4357812 to your computer and use it in GitHub Desktop.
require 'mechanize'
[['username1', 'password1'], ['username2', 'password2']].each do |user|
mech = Mechanize.new
mech.verify_mode = 0
page = mech.get 'http:// ... /oauth'
form = page.form
form.field_with(:name => /mail/i).value = user[0]
form.field_with(:name => /pass/i).value = user[1]
result = form.submit.link_with(:text=> /continue/).click
result.body =~ /logout/
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment