Class: Webrat::Session
- Inherits:
-
Object
- Object
- Webrat::Session
- 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) encoded_login = ["#{user}:#{pass}"].pack("m*").gsub(/\n/, '') header('HTTP_AUTHORIZATION', "Basic #{encoded_login}") if Webrat.adapter_class == MechanizeAdapter self.adapter.mechanize.auth(user, pass) end end |