diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-06-21 13:30:33 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-06-21 13:30:33 -0600 |
commit | 1c4fa54eec0b49f19ba0107a2028c354d60a9033 (patch) | |
tree | 8c9eef9410a39be702bd6a484d68c1e0bb97ee9a /activerecord/test | |
parent | 0e9a7059664eb9dee8e3afae60d26ff858d0d84b (diff) | |
download | rails-1c4fa54eec0b49f19ba0107a2028c354d60a9033.tar.gz rails-1c4fa54eec0b49f19ba0107a2028c354d60a9033.tar.bz2 rails-1c4fa54eec0b49f19ba0107a2028c354d60a9033.zip |
Add missing test cases for `attribute_method?`
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index f832ca3451..84a7a8ef68 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -831,6 +831,17 @@ class AttributeMethodsTest < ActiveRecord::TestCase end end + def test_attribute_method? + assert @target.attribute_method?(:title) + assert @target.attribute_method?(:title=) + assert_not @target.attribute_method?(:wibble) + end + + def test_attribute_method_returns_false_if_table_does_not_exist + @target.table_name = 'wibble' + assert_not @target.attribute_method?(:title) + end + private def new_topic_like_ar_class(&block) |