aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/fibered_render_test.rb
blob: f62af108124c400d94b1f6b31631b132d2f82cc2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# encoding: utf-8
require 'abstract_unit'
require 'controller/fake_models'

class TestController < ActionController::Base
end


class FiberedTest < ActiveSupport::TestCase

  def setup
    view_paths = ActionController::Base.view_paths
    @assigns = { :secret => 'in the sauce' }
    @view = ActionView::Base.new(view_paths, @assigns)
    @view.magic_medicine = true
    @controller_view = TestController.new.view_context
  end

  def test_render_template
    assert_equal "Hello world!", @view.render(:template => "test/hello_world")
  end

  def test_render_with_layout
    assert_equal %(<title></title>\nHello world!\n),
      @view.render(:template => "test/hello_world.erb", :layout => "layouts/yield")
  end
end if defined?(Fiber)