I wrote some tests for my controller which all worked as they should
until I added http authentication using 'before_filter :authenticate'
This is the authenticate method:
def authenticate
authenticate_or_request_with_http_basic do |user, password|
user == "x" && password == "y"
end
end
Now, for example, the following test fails and returns a 404:
def test_should_get_index
get :index
assert_response :success
end
Is there any way to pass the user and password to the test. Something
like:
get :index, :user =>"x", :password => "y"
I tried the above and all possible variations I could think of, but with
no success.
Thanks in advance
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---