Class: LoginPage

Inherits:
ServiceCall show all
Defined in:
lib/etvnet_seek/core/login_page.rb

Constant Summary collapse

LOGIN_URL =
"#{Page::BASE_URL}/login/"

Instance Attribute Summary

Attributes inherited from ServiceCall

#url

Instance Method Summary collapse

Methods inherited from ServiceCall

#get, #post

Constructor Details

#initializeLoginPage

Returns a new instance of LoginPage.



8
9
10
# File 'lib/etvnet_seek/core/login_page.rb', line 8

def initialize
  super(LOGIN_URL)
end

Instance Method Details

#login(username, password) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/etvnet_seek/core/login_page.rb', line 12

def  username, password
  headers = { "Content-Type" => "application/x-www-form-urlencoded" }

  response = post({ 'action' => '/login/', 'username' => username, 'password'=> password }, headers)

  cookie = response.response['set-cookie']

 # p cookie

#    unless cookie.nil?
#      cookie = cleanup_cookie(cookie)
#    end

  cookie
  #[0..cookie.index(";")-1]
end