Permalink
Browse files

Update serializer with new id find behaviour.

  • Loading branch information...
1 parent c4eb4ad commit f2c05a300299320ae0aea62b2ae7ab28cee92bce @elliotcm committed Mar 28, 2010
@@ -6,4 +6,4 @@ def db_teardown
after(:each) do
LightMongo.connection.drop_database(LightMongo.database.name)
end
-end
+end
@@ -27,7 +27,7 @@ def deserialize(object_to_deserialize)
end
if object_to_deserialize.has_key?('_embed') and object_to_deserialize['_embed'] == true
- return Object.const_get(class_name).find(object_to_deserialize['_id']).first
+ return Object.const_get(class_name).find(object_to_deserialize['_id'])
end
end
@@ -97,7 +97,7 @@ class TestClass
end
it "recovers the linked document" do
- TestClass.stub!(:find).with(@id).and_return([test_instance = mock(:test_instance)])
+ TestClass.stub!(:find).with(@id).and_return(test_instance = mock(:test_instance))
Serializer.deserialize(@object).should == test_instance
end

0 comments on commit f2c05a3

Please sign in to comment.