Skip to content

Commit

Permalink
Add test case for the | token in Journey scanner
Browse files Browse the repository at this point in the history
Journey's scanner tokenizes the `|` (:OR) operator when scanning route
urls such as `"/:foo|*bar"`. However, the current scanner test does not
have any test cases for the `|` operator. This commit adds a test case
for this particular token.
  • Loading branch information
vaidehijoshi committed Jun 18, 2018
1 parent c47c289 commit 3928e52
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions actionpack/test/journey/route/definition/scanner_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ def setup
["/~page", [[:SLASH, "/"], [:LITERAL, "~page"]]],
["/pa-ge", [[:SLASH, "/"], [:LITERAL, "pa-ge"]]],
["/:page", [[:SLASH, "/"], [:SYMBOL, ":page"]]],
["/:page|*foo", [
[:SLASH, "/"],
[:SYMBOL, ":page"],
[:OR, "|"],
[:STAR, "*foo"]
]],
["/(:page)", [
[:SLASH, "/"],
[:LPAREN, "("],
Expand Down

0 comments on commit 3928e52

Please sign in to comment.