+ test for MS-Author-Via header
authorAlexandre Bertails <bertails@w3.org>
Fri, 26 Aug 2011 14:02:12 -0400
changeset 6 392d9bd433b7
parent 5 c26795ac2c5b
child 7 e6bf64866274
+ test for MS-Author-Via header
src/test/scala/Test.scala
--- a/src/test/scala/Test.scala	Fri Aug 26 13:52:51 2011 -0400
+++ b/src/test/scala/Test.scala	Fri Aug 26 14:02:12 2011 -0400
@@ -26,11 +26,16 @@
 
   val timBL = host / "People/Berners-Lee/card#i"
     
-  "GET on TimBL's FOAF profile" should {
-    "return something" in {
-      val body:String = Http(timBL as_str)
+  "a GET on TimBL's FOAF profile" should {
+    val (via, body) = Http(timBL >+ { req =>
+      (req >:> { _("MS-Author-Via").head }, req as_str)
+    } )
+    "return an non empty document" in {
       body must not be empty
     }
+    """have the header "MS-Author-Via" set to SPARQL""" in {
+      via must_== "SPARQL"
+    }
   }
 
   val joe = host / "2007/wiki/people/JoeLambda"
@@ -42,7 +47,7 @@
 INSERT DATA { <http://dig.csail.xvm.mit.edu/2007/wiki/people/JoeLambda#JL> <http://xmlns.com/foaf/0.1/age> 66 }
 """
         
-  "INSERT query on Joe's URI" should {
+  "POSTing an INSERT query on Joe's URI" should {
     "return a 200" in {
       val httpCode:Int = Http(HttpCode(post(joe, insert)))
       httpCode must_== 200