spec/legacy/sti_spec.rb in dm-mongo-adapter-0.2.0.pre3 vs spec/legacy/sti_spec.rb in dm-mongo-adapter-0.6.0
- old
+ new
@@ -4,11 +4,11 @@
describe "Single Table Inheritance" do
before(:all) do
class ::Person
include DataMapper::Mongo::Resource
- property :id, ObjectID
+ property :id, ObjectId
property :name, String
property :job, String
property :type, Discriminator
end
@@ -22,10 +22,9 @@
end
it "should have a type property that reflects the class" do
[Person, Male, Father, Son].each_with_index do |model, i|
object = model.create!(:name => "#{model} #{i}")
- object.reload
object.type.should == model
end
end
it "should parent should return an instance of the child when type is explicitly specified" do