Class: Webrat::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/cucumber-wordpress/webrat-patches.rb,
lib/cucumber-wordpress/webrat-patches.rb

Defined Under Namespace

Classes: MockBody

Instance Method Summary collapse

Instance Method Details

#basic_auth(user, pass) ⇒ Object



71
72
73
74
75
76
77
# File 'lib/cucumber-wordpress/webrat-patches.rb', line 71

def basic_auth(user, pass)
   = ["#{user}:#{pass}"].pack("m*").gsub(/\n/, '')
  header('HTTP_AUTHORIZATION', "Basic #{}")
  if Webrat.adapter_class == MechanizeAdapter
    self.adapter.mechanize.auth(user, pass)
  end
end

#responseObject



20
21
22
# File 'lib/cucumber-wordpress/webrat-patches.rb', line 20

def response
  MockBody.new response_body
end