diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-05-31 11:49:50 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-05-31 11:49:50 +0200 |
commit | 3051356a8005518392f3414184daf933f5597092 (patch) | |
tree | 40025d0594669d9b6d466962c09a02e5bd9ae9a8 /activerecord/test | |
parent | 4f319ce37062fefe67841c53c4367db5ca934fb2 (diff) | |
parent | 7c8f88c6094aed000306e628b62f13bf71eb421e (diff) | |
download | rails-3051356a8005518392f3414184daf933f5597092.tar.gz rails-3051356a8005518392f3414184daf933f5597092.tar.bz2 rails-3051356a8005518392f3414184daf933f5597092.zip |
Merge pull request #15437 from sgrif/sg-missing-test-case
Add missing test case for writing unknown attributes
Diffstat (limited to 'activerecord/test')
-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 |