spec/integration/mongoid/inheritance_spec.rb in mongoid-1.1.4 vs spec/integration/mongoid/inheritance_spec.rb in mongoid-1.2.0
- old
+ new
@@ -14,11 +14,11 @@
Browser.delete_all
@browser = Browser.create(:version => 3, :name => "Test")
end
it "saves in the same collection as the root" do
- collection = Mongoid.database.collection("canvases")
+ collection = Mongoid.master.collection("canvases")
attributes = collection.find({ :name => "Test"}, {}).next_document
attributes["version"].should == 3
attributes["name"].should == "Test"
attributes["_type"].should == "Browser"
attributes["_id"].should == @browser.id
@@ -32,10 +32,10 @@
Firefox.delete_all
@firefox = Firefox.create(:version => 2, :name => "Testy")
end
it "saves in the same collection as the root" do
- collection = Mongoid.database.collection("canvases")
+ collection = Mongoid.master.collection("canvases")
attributes = collection.find({ :name => "Testy"}, {}).next_document
attributes["version"].should == 2
attributes["name"].should == "Testy"
attributes["_type"].should == "Firefox"
attributes["_id"].should == @firefox.id