Module: ZombieFans::Actions::Auth

Included in:
Robot
Defined in:
lib/zombie_fans/actions/auth.rb

Instance Method Summary collapse

Instance Method Details

#sign_inObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/zombie_fans/actions/auth.rb', line 18

def 
  agent.get('https://github.com/settings/profile') do |page|
    log_action 'SignIn', "with login: #{}, email: #{email}, password: #{password}."

    page.form_with(action: '/session') do |form|
      form['login'] = @login
      form['password'] = @password
    end.submit
  end
end

#sign_upObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/zombie_fans/actions/auth.rb', line 5

def 
  agent.get('https://github.com/join') do |page|
    retry_register = true
    while retry_register
      page =  page
      error_messages = page.search('.form-group.errored .error').map(&:text)
      retry_register = error_messages.any?
      log_error error_messages.join(', ').downcase if retry_register
    end
    save
  end
end