Sha256: 7c2389b48ebfea6f4f9f2e5b2bf207b9ba7ea47850c864157d7c2c04ef044932

Contents?: true

Size: 986 Bytes

Versions: 16

Compression:

Stored size: 986 Bytes

Contents

require File.dirname(__FILE__) + '/../abstract_unit'

class TestLayoutController < ActionController::Base
  layout "layouts/standard"
  
  def hello_world
  end
  
  def hello_world_outside_layout
  end

  def rescue_action(e) raise end
end

class ChildWithoutTestLayoutController < TestLayoutController
  layout nil

  def hello_world
  end
end

class ChildWithOtherTestLayoutController < TestLayoutController
  layout nil

  def hello_world
  end
end

class RenderTest < Test::Unit::TestCase
  def setup
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new

    @request.host = "www.nextangle.com"
  end

  def test_layout_rendering
    @request.action = "hello_world"
    response = process_request
    assert_equal "200 OK", response.headers["Status"]
    assert_equal "layouts/standard", response.template.template_name
  end


  private
    def process_request
      TestLayoutController.process(@request, @response)
    end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
devise_sociable-0.1.0 vendor/bundle/gems/actionpack-1.4.0/test/controller/layout_test.rb
actionpack-0.9.0 test/controller/layout_test.rb
actionpack-0.9.5 test/controller/layout_test.rb
actionpack-1.1.0 test/controller/layout_test.rb
actionpack-1.0.0 test/controller/layout_test.rb
actionpack-1.0.1 test/controller/layout_test.rb
actionpack-1.5.0 test/controller/layout_test.rb
actionpack-1.4.0 test/controller/layout_test.rb
actionpack-1.2.0 test/controller/layout_test.rb
actionpack-1.3.1 test/controller/layout_test.rb
actionpack-1.3.0 test/controller/layout_test.rb
actionpack-1.5.1 test/controller/layout_test.rb
actionpack-1.6.0 test/controller/layout_test.rb
actionpack-1.7.0 test/controller/layout_test.rb
actionpack-1.8.0 test/controller/layout_test.rb
actionpack-1.8.1 test/controller/layout_test.rb