spec/integration/mongoid/inheritance_spec.rb in mongoid-0.11.6 vs spec/integration/mongoid/inheritance_spec.rb in mongoid-0.11.7

- old
+ new

@@ -85,9 +85,27 @@ circle.canvas.should == @firefox end end + context "when document has subclasses" do + + before do + @firefox = Firefox.create(:name => "firefox") + end + + after do + Firefox.delete_all + end + + it "returns subclasses for querying parents" do + firefox = Canvas.where(:name => "firefox").first + firefox.should be_a_kind_of(Firefox) + firefox.should == @firefox + end + + end + context "deleting subclasses" do before do @firefox = Firefox.create(:name => "firefox") @browser = Browser.create(:name => "browser")