spec/integration/mongoid/inheritance_spec.rb in mongoid-0.11.0 vs spec/integration/mongoid/inheritance_spec.rb in mongoid-0.11.1
- old
+ new
@@ -34,10 +34,18 @@
attributes["name"].should == "Testy"
attributes["_type"].should == "Firefox"
attributes["_id"].should == @firefox.id
end
+ it "returns the document when querying for superclass" do
+ Browser.where(:name => "Testy").first.should == @firefox
+ end
+
+ it "returns the document when querying for root class" do
+ Canvas.where(:name => "Testy").first.should == @firefox
+ end
+
end
context "when document has associations" do
before do
@@ -95,10 +103,10 @@
it "deletes from the parent class collection" do
@firefox.delete
Firefox.count.should == 0
Browser.count.should == 1
- Canvas.count.should == 1
+ Canvas.count.should == 2
end
end
end