Merge branch 'master' into adv_design
This commit is contained in:
commit
a79c2d516a
5 changed files with 27 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue