Changing model_type_key one last time to 'type'. General doc refinements for 1.1.0.beta5 release

This commit is contained in:
Sam Lown 2011-04-30 13:13:38 +02:00
parent da3e524020
commit e8e1722241
7 changed files with 55 additions and 28 deletions

View file

@ -17,11 +17,11 @@ describe "Design Documents" do
end
it "should calculate a consistent checksum for model" do
WithTemplateAndUniqueID.design_doc.checksum!.should eql('ff6fa2eaf774397391942d51428c1fe2')
WithTemplateAndUniqueID.design_doc.checksum!.should eql('caa2b4c27abb82b4e37421de76d96ffc')
end
it "should calculate checksum for complex model" do
Article.design_doc.checksum!.should eql('fb65c06a76b6141529e31e894ad00b1a')
Article.design_doc.checksum!.should eql('70dff8caea143bf40fad09adf0701104')
end
it "should cache the generated checksum value" do

View file

@ -74,7 +74,7 @@ describe "Design View" do
it "should auto generate mapping from name" do
lambda { @klass.create(DesignViewModel, 'by_title') }.should_not raise_error
str = @design_doc['views']['by_title']['map']
str.should include("((doc['model'] == 'DesignViewModel') && (doc['title'] != null))")
str.should include("((doc['#{DesignViewModel.model_type_key}'] == 'DesignViewModel') && (doc['title'] != null))")
str.should include("emit(doc['title'], 1);")
str = @design_doc['views']['by_title']['reduce']
str.should include("return sum(values);")

View file

@ -56,7 +56,11 @@ describe "Model properties" do
end
it "should raise error if property name coincides with model type key" do
lambda { Person.property(Person.model_type_key) }.should raise_error(/already used/)
lambda { Cat.property(Cat.model_type_key) }.should raise_error(/already used/)
end
it "should not raise error if property name coincides with model type key on non-model" do
lambda { CatToy.property(Cat.model_type_key) }.should_not raise_error
end
it "should be auto timestamped" do