Renamed helpers to correspond to renamed Controller classes.
[merb_radiant.git] / radiant_specs / test / functional / .svn / text-base / application_controller_test.rb.svn-base
blob14365483a560f0faa3eaa71156c34826b096828a
1 require File.dirname(__FILE__) + '/../test_helper'
2 require 'site_controller'
4 # Re-raise errors caught by the controller.
5 class ApplicationController; def rescue_action(e) raise e end; end
7 class ApplicationControllerTest < Test::Unit::TestCase
8   fixtures :users
9   
10   test_helper :routing, :login
11   
12   class TestController < ApplicationController
13     def test
14       render :text => 'test'
15     end
16   end
17   
18   def setup
19     @controller = TestController.new
20     @request = ActionController::TestRequest.new
21     @response = ActionController::TestResponse.new
22     @user = users(:existing)
23     setup_custom_routes
24   end
25   
26   def teardown
27     teardown_custom_routes
28   end
29   
30   def test_ancestors
31     assert ApplicationController.include?(LoginSystem)
32   end
33   
34   def test_initialize
35     assert_equal Radiant::Config, @controller.config
36   end
37   
38   def test_before_filter
39     UserActionObserver.current_user = nil
40     login_as(@user)
41     get :test
42     assert_response :success
43     assert_equal @user, UserActionObserver.current_user
44   end
45 end