spec/public/model_spec.rb in dm-mongo-adapter-0.2.0.pre3 vs spec/public/model_spec.rb in dm-mongo-adapter-0.6.0
- old
+ new
@@ -1,37 +1,23 @@
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
describe DataMapper::Mongo::Model do
-
before(:all) do
class ::PropertyTest
include DataMapper::Mongo::Resource
- property :array, Array
- property :hash, Hash
- property :date, Date
- property :date_time, DateTime
+ property :array_attr, Array
+ property :hash_attr, Hash
end
end
describe '#property' do
- it 'should cast Array types to EmbeddedArray' do
- prop = PropertyTest.properties[:array]
- prop.type.should == DataMapper::Mongo::Types::EmbeddedArray
+ it 'should cast Array class to DataMapper::Mongo::Property::Array' do
+ prop = PropertyTest.properties[:array_attr]
+ prop.should be_kind_of(DataMapper::Mongo::Property::Array)
end
- it 'should cast Hash types to EmbeddedHash' do
- prop = PropertyTest.properties[:hash]
- prop.type.should == DataMapper::Mongo::Types::EmbeddedHash
+ it 'should cast Hash class to DataMapper::Mongo::Property::Hash' do
+ prop = PropertyTest.properties[:hash_attr]
+ prop.should be_kind_of(DataMapper::Mongo::Property::Hash)
end
-
- it 'should cast Hash types to Types::Date' do
- prop = PropertyTest.properties[:date]
- prop.type.should == DataMapper::Mongo::Types::Date
- end
-
- it 'should cast Hash types to Types::DateTime' do
- prop = PropertyTest.properties[:date_time]
- prop.type.should == DataMapper::Mongo::Types::DateTime
- end
end
-
end