Module: ZombieFans::Actions::Auth
- Included in:
- Robot
- Defined in:
- lib/zombie_fans/actions/auth.rb
Instance Method Summary collapse
Instance Method Details
#sign_in ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/zombie_fans/actions/auth.rb', line 18 def sign_in agent.get('https://github.com/settings/profile') do |page| log_action 'SignIn', "with login: #{login}, email: #{email}, password: #{password}." page.form_with(action: '/session') do |form| form['login'] = @login form['password'] = @password end.submit end end |
#sign_up ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/zombie_fans/actions/auth.rb', line 5 def sign_up agent.get('https://github.com/join') do |page| retry_register = true while retry_register page = fill_signup_page page = page.search('.form-group.errored .error').map(&:text) retry_register = .any? log_error .join(', ').downcase if retry_register end save end end |