~ test
authorAlexandre Bertails <bertails@w3.org>
Thu, 25 Aug 2011 16:19:54 -0400
branchtest
changeset 92 86990d772322
parent 91 c00ecbfcebb7
child 99 627d4604ba0d
~
src/main/scala/Main.scala
src/test/scala/Test.scala
--- a/src/main/scala/Main.scala	Thu Aug 25 15:31:35 2011 -0400
+++ b/src/main/scala/Main.scala	Thu Aug 25 16:19:54 2011 -0400
@@ -69,7 +69,7 @@
         def format(workout:Workout) = {
           import workout.{user => u, _}
           val uri = "%s://%s/user/%s/workout/%s" format (req.underlying.getScheme, host, user, id)
-          """{ "activity": "%s", "user": %s, "date": %d, "duration": %d, "distance": %f, "json": "%s", "gpx": "%s" }""" format (activity, user, date, distance, 12.0, uri+".json", uri+".gpx")
+          """{ "activity": "%s", "date": %d, "duration": %d, "distance": %f, "json": "%s", "gpx": "%s" }""" format (activity, date, distance, 12.0, uri+".json", uri+".gpx")
         }
         val jsonResponse = WorkoutDAO.getAllWorkoutsByUser(user) map { w => format(w) } mkString ("[ ", ", ", " ]")
         Ok ~> ContentType("application/json") ~> ResponseString(jsonResponse)
--- a/src/test/scala/Test.scala	Thu Aug 25 15:31:35 2011 -0400
+++ b/src/test/scala/Test.scala	Thu Aug 25 16:19:54 2011 -0400
@@ -8,8 +8,9 @@
 import com.novus.salat.dao._
 import com.mongodb.casbah.MongoConnection
 
[email protected]
 case class Workout(@Key("_id") id: ObjectId = new ObjectId,
-                   @Key("c") coordinates:Option[(Double, Double, Option[Double])])
+                   @Key("c") coordinates:Option[Seq[Double]])
 
 import org.scalatest.FunSuite
 
@@ -17,7 +18,7 @@
 
   test("") {
 
-    val run = Workout(coordinates=Some((-71.09068298339844,42.361671924591064,Some(66))))
+    val run = Workout(coordinates=Some(Seq(-71.09068298339844,42.361671924591064,66.0)))
     
       val runId = run.id
       println("runId: " + runId)