aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/record_identifier_test.rb
blob: ff5d7fd3bda99f501e0d9f3ba8ebda90f52e043d (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
33
34
require 'abstract_unit'
require 'controller/fake_models'

class ControllerRecordIdentifierTest < ActiveSupport::TestCase
  include ActionController::RecordIdentifier

  def setup
    @record = Comment.new
  end

  def test_dom_id_deprecation
    assert_deprecated(/dom_id method will no longer be included by default in controllers/) do
      dom_id(@record)
    end
  end

  def test_dom_class_deprecation
    assert_deprecated(/dom_class method will no longer be included by default in controllers/) do
      dom_class(@record)
    end
  end

  def test_dom_id_from_module_deprecation
    assert_deprecated(/Calling ActionController::RecordIdentifier.dom_id is deprecated/) do
      ActionController::RecordIdentifier.dom_id(@record)
    end
  end

  def test_dom_class_from_module_deprecation
    assert_deprecated(/Calling ActionController::RecordIdentifier.dom_class is deprecated/) do
      ActionController::RecordIdentifier.dom_class(@record)
    end
  end
end