diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-01-29 01:59:55 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-01-29 01:59:55 +0000 |
commit | a1a9889b06faf5e994fc29d462c7063b5ff37a3a (patch) | |
tree | 9ce94665dcba8e21e567605e0a0f0c41b99851cd /actionpack/test | |
parent | 166c63818e901e64786a76029febf7c9cdb40f2d (diff) | |
download | rails-a1a9889b06faf5e994fc29d462c7063b5ff37a3a.tar.gz rails-a1a9889b06faf5e994fc29d462c7063b5ff37a3a.tar.bz2 rails-a1a9889b06faf5e994fc29d462c7063b5ff37a3a.zip |
Move basic auth test controller inside the test class
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/http_basic_authentication_test.rb | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/actionpack/test/controller/http_basic_authentication_test.rb b/actionpack/test/controller/http_basic_authentication_test.rb index 08a25bfdb8..fbc94a0df7 100644 --- a/actionpack/test/controller/http_basic_authentication_test.rb +++ b/actionpack/test/controller/http_basic_authentication_test.rb @@ -1,35 +1,35 @@ require 'abstract_unit' -class DummyController < ActionController::Base - before_filter :authenticate, :only => :index - before_filter :authenticate_with_request, :only => :display +class HttpBasicAuthenticationTest < ActionController::TestCase + class DummyController < ActionController::Base + before_filter :authenticate, :only => :index + before_filter :authenticate_with_request, :only => :display - def index - render :text => "Hello Secret" - end + def index + render :text => "Hello Secret" + end - def display - render :text => 'Definitely Maybe' - end + def display + render :text => 'Definitely Maybe' + end - private + private - def authenticate - authenticate_or_request_with_http_basic do |username, password| - username == 'lifo' && password == 'world' + def authenticate + authenticate_or_request_with_http_basic do |username, password| + username == 'lifo' && password == 'world' + end end - end - def authenticate_with_request - if authenticate_with_http_basic { |username, password| username == 'pretty' && password == 'please' } - @logged_in = true - else - request_http_basic_authentication("SuperSecret") + def authenticate_with_request + if authenticate_with_http_basic { |username, password| username == 'pretty' && password == 'please' } + @logged_in = true + else + request_http_basic_authentication("SuperSecret") + end end end -end -class HttpBasicAuthenticationTest < ActionController::TestCase AUTH_HEADERS = ['HTTP_AUTHORIZATION', 'X-HTTP_AUTHORIZATION', 'X_HTTP_AUTHORIZATION', 'REDIRECT_X_HTTP_AUTHORIZATION'] tests DummyController |