aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/capture_helper_test.rb
blob: f887c9ab5b4f5591ce0470eddbc2506e978e1085 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'abstract_unit'

class CaptureHelperTest < ActionView::TestCase
  def setup
    super
    @_content_for = Hash.new {|h,k| h[k] = "" }
  end

  def test_content_for
    assert ! content_for?(:title)
    content_for :title, 'title'
    assert content_for?(:title)
    assert ! content_for?(:something_else)
  end

  def test_with_output_buffer_does_not_assume_there_is_an_output_buffer
    av = ActionView::Base.new
    assert_nil av.output_buffer
    assert_equal "", av.with_output_buffer {}
  end
end