#50 - advanced tests (test 15)
authorFedor Yudanov <fedwiz@academ.org>
Fri, 5 Apr 2013 13:28:58 +0000 (20:28 +0700)
committerFedor Yudanov <fedwiz@academ.org>
Fri, 5 Apr 2013 13:28:58 +0000 (20:28 +0700)
rbejdb/test/t2.rb

index 5f8ec26..50be66c 100644 (file)
@@ -398,4 +398,18 @@ class EJDBTestUnit < Test::Unit::TestCase
 
     puts "test_ejdbd_tx1 has passed successfull"
   end
+
+  def test_ejdbe_create_collection_on_upsert
+    assert_not_nil $jb
+    assert $jb.is_open?
+
+    results = $jb.update("upsertcoll", {:foo => "bar", "$upsert" => {:foo => "bar"}})
+    assert_equal(1, results.count)
+
+    obj = $jb.find_one("upsertcoll", {:foo => "bar"})
+    assert_equal("bar", obj["foo"])
+
+    puts "test_ejdbe_create_collection_on_upsert has passed successfull"
+  end
+
 end