Permalink
Browse files

Double-checking has_one address issue

  • Loading branch information...
1 parent 7abc39d commit 5e98a17ee56ce626c15b05bbd8c64323b8ac2217 @durran durran committed Dec 26, 2009
Showing with 16 additions and 0 deletions.
  1. +16 −0 spec/integration/mongoid/document_spec.rb
View
16 spec/integration/mongoid/document_spec.rb
@@ -174,6 +174,22 @@
end
+ context "when address is a has one" do
+
+ before do
+ @owner = PetOwner.create(:title => "AKC")
+ @address = Address.new(:street => "Fido Street")
+ @owner.address = @address
+ @owner.save
+ end
+
+ it "is a single object and not an array" do
+ @from_db = PetOwner.find(@owner.id)
+ @from_db.address.should == @address
+ end
+
+ end
+
describe "#paginate" do
before do

0 comments on commit 5e98a17

Please sign in to comment.