Working on adding support for allowing dynamic properties

This commit is contained in:
Sam Lown 2010-09-17 23:25:56 +02:00
parent 85cd1308bc
commit 97347e70e3
5 changed files with 43 additions and 7 deletions

View file

@ -88,6 +88,13 @@ describe "Model properties" do
expect { @card.write_attribute(:this_property_should_not_exist, 823) }.to raise_error(ArgumentError)
end
it 'should not raise an error if the property does not exist and dynamic properties are allowed' do
@card.class.allow_dynamic_properties = true
expect { @card.write_attribute(:this_property_should_not_exist, 823) }.to_not raise_error(ArgumentError)
@card.class.allow_dynamic_properties = false
end
it "should let you use write_attribute on readonly properties" do
lambda {
@card.read_only_value = "foo"