Merge branch 'master' into adv_design

This commit is contained in:
Sam Lown 2011-02-05 22:39:04 +01:00
commit a79c2d516a
5 changed files with 27 additions and 6 deletions

View file

@ -24,6 +24,9 @@ class DummyModel < CouchRest::Model::Base
property :sub_models do |child|
child.property :title
end
property :param_free_sub_models do
property :title
end
end
class WithCastedCallBackModel < Hash
@ -100,6 +103,14 @@ describe CouchRest::Model::CastedModel do
@obj.sub_models << {:title => 'test'}
@obj.sub_models.first.title.should eql('test')
end
it "should be empty intitally (without params)" do
@obj.param_free_sub_models.should_not be_nil
@obj.param_free_sub_models.should be_empty
end
it "should be updatable using a hash (without params)" do
@obj.param_free_sub_models << {:title => 'test'}
@obj.param_free_sub_models.first.title.should eql('test')
end
end
describe "casted as attribute" do