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

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

Add missing test case for writing unknown attributes
This commit is contained in:
Yves Senn 2014-05-31 11:49:50 +02:00
commit 3051356a80

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