From a2f13e15f324756fe55f4876184756d7e6c995b8 Mon Sep 17 00:00:00 2001 From: Kris Kemper Date: Sun, 23 Mar 2014 08:32:37 -0400 Subject: Don't recurse infinitely when calling non-existent method on super --- activerecord/test/cases/attribute_methods_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activerecord/test/cases') diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 495b43c9e5..4c96c2f4fd 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -843,6 +843,18 @@ class AttributeMethodsTest < ActiveRecord::TestCase assert_equal !real_topic.title?, klass.find(real_topic.id).title? end + def test_calling_super_when_parent_does_not_define_method_raises_error + klass = new_topic_like_ar_class do + def some_method_that_is_not_on_super + super + end + end + + assert_raise(NoMethodError) do + klass.new.some_method_that_is_not_on_super + end + end + private def new_topic_like_ar_class(&block) -- cgit v1.2.3