diff options
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index fb4eacb632..9bc04ed29c 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -45,6 +45,10 @@ class ReadonlyTitlePost < Post attr_readonly :title end +class ProtectedTitlePost < Post + attr_protected :title +end + class Weird < ActiveRecord::Base; end class Boolean < ActiveRecord::Base; end @@ -491,8 +495,9 @@ class BasicsTest < ActiveRecord::TestCase def test_attributes_guard_protected_attributes_is_deprecated attributes = { "title" => "An amazing title" } - topic = Topic.new - assert_deprecated { topic.send(:attributes=, attributes, false) } + post = ProtectedTitlePost.new + assert_deprecated { post.send(:attributes=, attributes, false) } + assert_equal "An amazing title", post.title end def test_multiparameter_attributes_on_date |