aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-16 22:55:02 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2013-01-16 23:09:36 -0200
commit038574a5385e07f1091e355b78558821e123a48c (patch)
treedc0128294fd6e7ceda3cc32b6f538caab90e37be /actionpack/test/controller
parentf5aa4d9a1bc4b77cb5d5fdd970322a80fdac18c6 (diff)
downloadrails-038574a5385e07f1091e355b78558821e123a48c.tar.gz
rails-038574a5385e07f1091e355b78558821e123a48c.tar.bz2
rails-038574a5385e07f1091e355b78558821e123a48c.zip
Deprecate direct calls to AC::RecordIdentifier.dom_id and dom_class
Also add some generic tests to ensure they're properly deprecated.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/record_identifier_test.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/actionpack/test/controller/record_identifier_test.rb b/actionpack/test/controller/record_identifier_test.rb
new file mode 100644
index 0000000000..3067daf697
--- /dev/null
+++ b/actionpack/test/controller/record_identifier_test.rb
@@ -0,0 +1,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