If I run the test via command line => "cucumber --require ./features features/
mytestwebserver.com/basic-auth-test.feature" I get the following error (for each of both scenarios):
""
Scenario: test basic auth # features/mytestwebserver.com/basic-auth-test.feature:9
When I visit the url "http://sn1.slaves.memonews.com/status.php" # features/mytestwebserver.com/steps/basic-auth-test_steps.rb:5
401 => Net::HTTPUnauthorized (Mechanize::ResponseCodeError) ""
The content of webrat's log file is:
""
D, [2012-09-27T09:42:16.957571 #27060] DEBUG -- : REQUESTING PAGE: GET http://http://mytestwebserver.com/status.php with {} and HTTP headers {"HTTP_AUTHORIZATION"=>"Basic bmFnaW9zOlFZVURwQ1NJVHp1OHZuQVMxcEZk"}
""
The login via browser to the website works, and the
browsers webdeveloper extension prints exactly the same
authorization hash,
therefore I assume the credentials are correct ?!? Here is the header information from successful browser login (manually):
""
GET /status.php HTTP/1.1
Host: mytestwebserver.com
Connection: keep-alive
Cache-Control: max-age=0
Authorization: Basic bmFnaW9zOlFZVURwQ1NJVHp1OHZuQVMxcEZk""
====================================
while
looking for further debugging options I wanted to include
save_and_open_page to have a look at the page webrat is dealing with,
but I got the error:
""
undefined method `content' for nil:NilClass (NoMethodError)
/var/lib/gems/1.8/gems/webrat-0.7.2/lib/webrat/adapters/mechanize.rb:43:in `response_body'
/var/lib/gems/1.8/gems/webrat-0.7.2/lib/webrat/core/save_and_open_page.rb:14:in `save_and_open_page'
/var/lib/gems/1.8/gems/webrat-0.7.2/lib/webrat/core/save_and_open_page.rb:13:in `open'
/var/lib/gems/1.8/gems/webrat-0.7.2/lib/webrat/core/save_and_open_page.rb:13:in `save_and_open_page'
""
hmmmmm, no idea what to do....
====================================
Now
I really don't know what to check further and how to get to a working
basic_auth authorization......any help highly appreciated. If you need more information just let me know...
many thanks in advance...:: Gerd ::....