summaryrefslogtreecommitdiff
path: root/cask/test/src/test
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-07-25 18:57:35 +0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-07-25 18:57:35 +0800
commit42343542d6435caa74dcbefc3288fe08e7252706 (patch)
treee910228fae74fe29295cda7bdb4c7870853dbc63 /cask/test/src/test
parente52c6f57ef42b54a355d0976cb43f6762280e855 (diff)
downloadcask-42343542d6435caa74dcbefc3288fe08e7252706.tar.gz
cask-42343542d6435caa74dcbefc3288fe08e7252706.tar.bz2
cask-42343542d6435caa74dcbefc3288fe08e7252706.zip
StaticFiles and RedirectAbort tests
Diffstat (limited to 'cask/test/src/test')
-rw-r--r--cask/test/src/test/cask/ExampleTests.scala13
-rw-r--r--cask/test/src/test/cask/StaticFiles.scala2
2 files changed, 13 insertions, 2 deletions
diff --git a/cask/test/src/test/cask/ExampleTests.scala b/cask/test/src/test/cask/ExampleTests.scala
index f521660..2ecdcd6 100644
--- a/cask/test/src/test/cask/ExampleTests.scala
+++ b/cask/test/src/test/cask/ExampleTests.scala
@@ -41,7 +41,7 @@ object ExampleTests extends TestSuite{
requests.get(host + "/user").statusCode ==> 404
- requests.get(host + "/post/123?query=xyz&query=abc") ==>
+ requests.get(host + "/post/123?query=xyz&query=abc").text() ==>
"Post 123 ArrayBuffer(xyz, abc)"
requests.get(host + "/post/123").text() ==>
@@ -58,5 +58,16 @@ object ExampleTests extends TestSuite{
requests.get(host + "/path/one/two/three").text() ==>
"Subpath List(one, two, three)"
}
+
+ 'StaticFiles - test(StaticFiles){ host =>
+ requests.get(host + "/static/example.txt").text() ==>
+ "the quick brown fox jumps over the lazy dog"
+ }
+
+ 'RedirectAbort - test(RedirectAbort){ host =>
+ val resp = requests.get(host + "/")
+ resp.statusCode ==> 401
+ resp.history.get.statusCode ==> 301
+ }
}
}
diff --git a/cask/test/src/test/cask/StaticFiles.scala b/cask/test/src/test/cask/StaticFiles.scala
index 378988a..d51b35a 100644
--- a/cask/test/src/test/cask/StaticFiles.scala
+++ b/cask/test/src/test/cask/StaticFiles.scala
@@ -7,7 +7,7 @@ object StaticFiles extends cask.MainRoutes{
}
@cask.static("/static")
- def staticRoutes = "cask/test/src/test/cask"
+ def staticRoutes = "cask/resources/cask"
initialize()
}