1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add missing test case for writing unknown attributes

This commit is contained in:
Sean Griffin 2014-05-30 15:48:41 -07:00
parent 2c51c405e0
commit 7c8f88c609

View file

@ -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