summaryrefslogtreecommitdiffstats
path: root/src/test/scala/optional.scala
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-02-28 23:28:55 -0600
committerJesse Luehrs <doy@tozt.net>2013-02-28 23:28:55 -0600
commit64e67cfd70f18b67948fd3f7b03e39af9b5d31c3 (patch)
treeff492011ad73bb7c93d8b1537e6d34b86d18a88f /src/test/scala/optional.scala
parent457495c0ae63258c7d86b48c07b719565233e7a7 (diff)
downloadscala-path-router-64e67cfd70f18b67948fd3f7b03e39af9b5d31c3.tar.gz
scala-path-router-64e67cfd70f18b67948fd3f7b03e39af9b5d31c3.zip
cleanups
Diffstat (limited to 'src/test/scala/optional.scala')
-rw-r--r--src/test/scala/optional.scala85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/test/scala/optional.scala b/src/test/scala/optional.scala
deleted file mode 100644
index ade237c..0000000
--- a/src/test/scala/optional.scala
+++ /dev/null
@@ -1,85 +0,0 @@
-import org.scalatest.FunSuite
-import router.test._
-
-import router.Router
-
-class Optional extends FunSuite {
- val router = new Router[Boolean]
-
- router addRoute (
- ":controller/?:action",
- true,
- defaults = Map(
- "action" -> "index"
- ),
- validations = Map(
- "action" -> """\D+""".r
- )
- )
-
- router addRoute (
- ":controller/:id/?:action",
- true,
- defaults = Map(
- "action" -> "show"
- ),
- validations = Map(
- "id" -> """\d+""".r
- )
- )
-
- test ("routes match properly") {
- assert(
- router matches "people", Map(
- "controller" -> "people",
- "action" -> "index"
- )
- )
-
- assert(
- router matches "people/new", Map(
- "controller" -> "people",
- "action" -> "new"
- )
- )
-
- assert(
- router matches "people/create", Map(
- "controller" -> "people",
- "action" -> "create"
- )
- )
-
- assert(
- router matches "people/56", Map(
- "controller" -> "people",
- "action" -> "show",
- "id" -> "56"
- )
- )
-
- assert(
- router matches "people/56/edit", Map(
- "controller" -> "people",
- "action" -> "edit",
- "id" -> "56"
- )
- )
-
- assert(
- router matches "people/56/remove", Map(
- "controller" -> "people",
- "action" -> "remove",
- "id" -> "56"
- )
- )
-
- assert(
- router matches "people/56/update", Map(
- "controller" -> "people",
- "action" -> "update",
- "id" -> "56"
- )
- )
- }
-}