Sha256: ea62ed8c41b2d9ed73663d89379f1a220d0fd51512dcbffb7ee395782bd01bf0

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'
require 'site_controller'

# Re-raise errors caught by the controller.
class ApplicationController; def rescue_action(e) raise e end; end

class ApplicationControllerTest < Test::Unit::TestCase
  fixtures :users
  
  class TestController < ApplicationController
    def test
      render :text => 'test'
    end
  end
  
  def setup
    @controller = TestController.new
    @request = ActionController::TestRequest.new
    @response = ActionController::TestResponse.new
    @user = users(:existing)
  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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radiant-0.5.0 test/functional/application_controller_test.rb
radiant-0.5.1 test/functional/application_controller_test.rb
radiant-0.5.2 test/functional/application_controller_test.rb