Testing http basic authentication with Cucumber and RSpec in Rails 3.2.3
问题 I want to test the build-in basic http authentication mechanism in Rails 3.2.3. I have tried to test the http authentication in both RSpec and Cucumber but with a failing step in both tools. In Cucumber I get the following message on running my Feature: When I perform HTTP authentication as "admin" with "test" # features/step_definitions/web_steps.rb:1 undefined method `env' for nil:NilClass (NoMethodError) ./features/step_definitions/web_steps.rb:3:in `/^I perform HTTP authentication as "([^