Skip to content

Support pattern /articles/:id.:format #2

Description

@ngocdaothanh
"A router" should "handle dots" in {
  val router = new Router[String]
  router.pattern("/articles/:id",         "show")
  router.pattern("/articles/:id.:format", "show")

  val routed1 = router.route("/articles/123")
  routed1.target           should be ("show")
  routed1.params.size      should be (1)
  routed1.params.get("id") should be ("123")

  val routed2 = router.route("/articles/123.json")
  routed2.target               should be ("show")
  routed2.params.size          should be (2)
  routed2.params.get("id")     should be ("123")
  routed2.params.get("format") should be ("json")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions