diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-09-17 09:29:02 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-09-17 09:29:02 +0000 |
commit | acbec3e565909da5811488e88066a01f71b68a94 (patch) | |
tree | 3918c0ee69cdd55d82286de127c4f6bc2b0d27e4 /activerecord/test/base_test.rb | |
parent | bfb906a905a1e8774e438b10e8cf703a829b55dc (diff) | |
download | rails-acbec3e565909da5811488e88066a01f71b68a94.tar.gz rails-acbec3e565909da5811488e88066a01f71b68a94.tar.bz2 rails-acbec3e565909da5811488e88066a01f71b68a94.zip |
Ensure that custom mutators aren't redefined by define_attribute_methods. [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7500 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-x | activerecord/test/base_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index bf9a8a5f90..4fb7f39ecc 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -394,6 +394,13 @@ class BasicsTest < Test::Unit::TestCase assert_equal 9900, Topic.find(2).written_on.usec end end + + def test_custom_mutator + topic = Topic.find(1) + # This mutator is protected in the class definition + topic.send(:approved=, true) + assert topic.instance_variable_get("@custom_approved") + end def test_destroy topic = Topic.find(1) |