test/unit/test_support.rb in mongo_mapper-unstable-2009.11.18 vs test/unit/test_support.rb in mongo_mapper-unstable-2009.12.4
- old
+ new
@@ -1,10 +1,8 @@
require 'test_helper'
class SupportTest < Test::Unit::TestCase
- include MongoMapper::Types
-
context "Array#to_mongo" do
should "convert value to_a" do
Array.to_mongo([1, 2, 3, 4]).should == [1, 2, 3, 4]
Array.to_mongo('1').should == ['1']
Array.to_mongo({'1' => '2', '3' => '4'}).should == [['1', '2'], ['3', '4']]
@@ -331,6 +329,14 @@
Time.zone = 'Hawaii'
Time.from_mongo(nil).should be_nil
Time.zone = nil
end
end
+
+ context "Mongo::ObjectID.to_json" do
+ should "convert object id to string" do
+ id = Mongo::ObjectID.new
+ id.to_json.should == id.to_s
+ end
+ end
+
end
\ No newline at end of file