aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-08-25 13:34:52 +0200
committerPiotr Sarnacki <drogus@gmail.com>2012-08-28 11:19:37 +0200
commitf4d493ed7c451f3df7602c5164a1954caa40284e (patch)
tree5d272ddd5c54ae164620bf104895943f38dc087b /actionpack/test/template
parent8eb4600c881f55370663f3a6225271d9cdc7bdbd (diff)
downloadrails-f4d493ed7c451f3df7602c5164a1954caa40284e.tar.gz
rails-f4d493ed7c451f3df7602c5164a1954caa40284e.tar.bz2
rails-f4d493ed7c451f3df7602c5164a1954caa40284e.zip
Fix ActionView::RecordIdentifier to work as a singleton
We extend it with self, but the methods were not working properly were used directly on module.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r--actionpack/test/template/record_identifier_test.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/test/template/record_identifier_test.rb b/actionpack/test/template/record_identifier_test.rb
index a7f1420059..22038110a5 100644
--- a/actionpack/test/template/record_identifier_test.rb
+++ b/actionpack/test/template/record_identifier_test.rb
@@ -37,4 +37,13 @@ class RecordIdentifierTest < ActiveSupport::TestCase
def test_dom_class_with_prefix
assert_equal "custom_prefix_#{@singular}", dom_class(@record, :custom_prefix)
end
+
+ def test_dom_id_as_singleton_method
+ @record.save
+ assert_equal "#{@singular}_1", ActionView::RecordIdentifier.dom_id(@record)
+ end
+
+ def test_dom_class_as_singleton_method
+ assert_equal @singular, ActionView::RecordIdentifier.dom_class(@record)
+ end
end