aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-09 17:21:29 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-09 17:21:29 +0000
commit11f766d3eb85fe363a17a861a9426307cd80d7f6 (patch)
tree7e95c9c013982f2f1ad4f6b893ae19321ae07667 /actionpack/test/controller
parent677d92299b36a0eeaf8ec6aec211f5e6e325fe0d (diff)
downloadrails-11f766d3eb85fe363a17a861a9426307cd80d7f6.tar.gz
rails-11f766d3eb85fe363a17a861a9426307cd80d7f6.tar.bz2
rails-11f766d3eb85fe363a17a861a9426307cd80d7f6.zip
Removed authentication framework as xal made me realize that with noradios conditional filters, it was actually more code to use the framework than doing it by hand. Killing a darling! Props to noradio for the patch and xal for the nerve to stand up and question the captain before the plane crashed. Oh, and a pad on my own back for walking away from a couple of hours of work without getting pissy
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/authentication_test.rb102
1 files changed, 0 insertions, 102 deletions
diff --git a/actionpack/test/controller/authentication_test.rb b/actionpack/test/controller/authentication_test.rb
deleted file mode 100644
index 098d0596ff..0000000000
--- a/actionpack/test/controller/authentication_test.rb
+++ /dev/null
@@ -1,102 +0,0 @@
-require File.dirname(__FILE__) + '/../abstract_unit'
-
-class AuthenticationTest < Test::Unit::TestCase
- class ApplicationController < ActionController::Base
- authentication :by => '@session[:authenticated]', :before => '@session[:return_to] = "/weblog/"', :failure => { :controller => "login" }
- end
-
- class WeblogController < ApplicationController
- def show() render_text "I showed something" end
- def index() render_text "I indexed something" end
- def edit() render_text "I edited something" end
- def update() render_text "I updated something" end
- def login
- @session[:authenticated] = true
- @session[:return_to] ? redirect_to_path(@session[:return_to]) : render_nothing
- end
- end
-
- class AuthenticatesWeblogController < WeblogController
- authenticates :edit, :update
- end
-
- class AuthenticatesAllWeblogController < WeblogController
- authenticates_all
- end
-
- class AuthenticatesAllExceptWeblogController < WeblogController
- authenticates_all_except :show, :index, :login
- end
-
- class AuthenticatesSomeController < AuthenticatesAllWeblogController
- authenticates_all_except :show
- end
-
- def setup
- @request = ActionController::TestRequest.new
- @response = ActionController::TestResponse.new
- end
-
- def test_access_on_authenticates
- @controller = AuthenticatesWeblogController.new
-
- get :show
- assert_success
-
- get :edit
- assert_redirected_to :controller => "login"
- end
-
- def test_access_on_authenticates_all
- @controller = AuthenticatesAllWeblogController.new
-
- get :show
- assert_redirected_to :controller => "login"
-
- get :edit
- assert_redirected_to :controller => "login"
- end
-
- def test_access_on_authenticates_all_except
- @controller = AuthenticatesAllExceptWeblogController.new
-
- get :show
- assert_success
-
- get :edit
- assert_redirected_to :controller => "login"
- end
-
- def test_access_on_authenticates_some
- @controller = AuthenticatesSomeController.new
-
- get :show
- assert_success
-
- get :edit
- assert_redirected_to :controller => "login"
- end
-
- def test_authenticated_access_on_authenticates
- @controller = AuthenticatesWeblogController.new
-
- get :login
- assert_success
-
- get :show
- assert_success
-
- get :edit
- assert_success
- end
-
- def test_before_condition
- @controller = AuthenticatesWeblogController.new
-
- get :edit
- assert_redirected_to :controller => "login"
-
- get :login
- assert_redirect_url "http://test.host/weblog/"
- end
-end \ No newline at end of file