Browse files

Merge pull request #15437 from sgrif/sg-missing-test-case

Add missing test case for writing unknown attributes
  • Loading branch information...
2 parents 4f319ce + 7c8f88c commit 3051356a8005518392f3414184daf933f5597092 @senny senny committed May 31, 2014
Showing with 2 additions and 0 deletions.
  1. +2 −0 activerecord/test/cases/attribute_methods_test.rb
View
2 activerecord/test/cases/attribute_methods_test.rb
@@ -299,6 +299,8 @@ def test_read_attribute_raises_missing_attribute_error_when_not_exists
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

0 comments on commit 3051356

Please sign in to comment.