test/functional/application_controller_test.rb in radiant-0.5.2 vs test/functional/application_controller_test.rb in radiant-0.6.0

- old
+ new

@@ -5,10 +5,12 @@ class ApplicationController; def rescue_action(e) raise e end; end class ApplicationControllerTest < Test::Unit::TestCase fixtures :users + test_helper :routing + class TestController < ApplicationController def test render :text => 'test' end end @@ -16,29 +18,27 @@ def setup @controller = TestController.new @request = ActionController::TestRequest.new @response = ActionController::TestResponse.new @user = users(:existing) + setup_custom_routes end + def teardown + teardown_custom_routes + end + def test_ancestors assert ApplicationController.include?(LoginSystem) end def test_initialize assert_equal Radiant::Config, @controller.config end - def test_default_parts - assert_equal ['body', 'extended'], @controller.default_parts - end - def test_before_filter - with_routing do |routes| - routes.map ':controller/:action' - UserActionObserver.current_user = nil - get :test, {}, { :user => @user } - assert_response :success - assert_equal @user, UserActionObserver.current_user - end + UserActionObserver.current_user = nil + get :test, {}, { 'user' => @user } + assert_response :success + assert_equal @user, UserActionObserver.current_user end end \ No newline at end of file