how to check login to rails 3.1 application using http basic auth using rspec2 and capybara?
I use this;
describe "GET 'index'" do it "should be successful" do request.env["HTTP_AUTHORIZATION"] = "Basic " + Base64::encode64("username:password") get 'index' response.should be_success end end
but he gives me this error;
NoMethodError: undefined method `env' for nil:NilClass
source share