Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding a new test that inserts a couple of records in the test_data s…

…chema
  • Loading branch information...
commit cc0cc471229a56de6c510d3a5dcc8d413d8219e1 1 parent c086fd6
@tvaughan77 authored
Showing with 13 additions and 0 deletions.
  1. +13 −0 mag_art_dl/src/test/scala/vaughan/dao/ArticleMongoDBSuite.scala
View
13 mag_art_dl/src/test/scala/vaughan/dao/ArticleMongoDBSuite.scala
@@ -20,4 +20,17 @@ class ArticleMongoDBSuite extends FunSuite {
val mongoDB = mongoConn("casbah_test")
}
+ test("test inserting and retrieving") {
+ val mongoColl = MongoConnection()("casbah_test")("test_data")
+ val user1 = MongoDBObject("user" -> "bwmcadams",
+ "email" -> "~~brendan~~<AT>10genDOTcom")
+ val user2 = MongoDBObject("user" -> "someOtherUser")
+ mongoColl += user1
+ mongoColl += user2
+ mongoColl.find()
+ // com.mongodb.casbah.MongoCursor =
+ // MongoCursor{Iterator[DBObject] with 2 objects.}
+
+ for { x <- mongoColl} println(x)
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.