aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/record_tag_helper_test.rb
blob: ab110d8314050e5178109f2f3ff259619320ca87 (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
28
29
30
31
32
# frozen_string_literal: true
require "abstract_unit"

class RecordTagPost
  extend ActiveModel::Naming

  attr_accessor :id, :body

  def initialize
    @id   = 45
    @body = "What a wonderful world!"

    yield self if block_given?
  end
end

class RecordTagHelperTest < ActionView::TestCase
  tests ActionView::Helpers::RecordTagHelper

  def setup
    super
    @post = RecordTagPost.new
  end

  def test_content_tag_for
    assert_raises(NoMethodError) { content_tag_for(:li, @post) }
  end

  def test_div_for
    assert_raises(NoMethodError) { div_for(@post, class: "special") }
  end
end