diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-05-30 15:48:41 -0700 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-05-30 16:13:31 -0700 |
commit | 7c8f88c6094aed000306e628b62f13bf71eb421e (patch) | |
tree | aa7b450b904002f45548a32a7e4ab209575b89ae /activerecord | |
parent | 2c51c405e0eb75a1c3acc7f1ec0da4d4ee90cb30 (diff) | |
download | rails-7c8f88c6094aed000306e628b62f13bf71eb421e.tar.gz rails-7c8f88c6094aed000306e628b62f13bf71eb421e.tar.bz2 rails-7c8f88c6094aed000306e628b62f13bf71eb421e.zip |
Add missing test case for writing unknown attributes
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/attribute_methods_test.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb index 38faffb870..da2876170e 100644 --- a/activerecord/test/cases/attribute_methods_test.rb +++ b/activerecord/test/cases/attribute_methods_test.rb @@ -299,6 +299,8 @@ class AttributeMethodsTest < ActiveRecord::TestCase computer = Computer.select('id').first assert_raises(ActiveModel::MissingAttributeError) { computer[:developer] } assert_raises(ActiveModel::MissingAttributeError) { computer[:extendedWarranty] } + assert_raises(ActiveModel::MissingAttributeError) { computer[:no_column_exists] = 'Hello!' } + assert_nothing_raised { computer[:developer] = 'Hello!' } end def test_read_attribute_when_false |