aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorvaidehijoshi <vaidehi.sj@gmail.com>2018-06-18 09:32:23 -0700
committervaidehijoshi <vaidehi.sj@gmail.com>2018-06-18 09:32:23 -0700
commit3928e52bf849b618584540ee9229c7974f5c9de1 (patch)
tree3915ab41b31fe9877c80655f6f2e128c0c74fb85 /actionpack/test
parentc47c289ac02cb60e8b01bb8b1892c040794b418f (diff)
downloadrails-3928e52bf849b618584540ee9229c7974f5c9de1.tar.gz
rails-3928e52bf849b618584540ee9229c7974f5c9de1.tar.bz2
rails-3928e52bf849b618584540ee9229c7974f5c9de1.zip
Add test case for the `|` token in Journey scanner
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.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/journey/route/definition/scanner_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/journey/route/definition/scanner_test.rb b/actionpack/test/journey/route/definition/scanner_test.rb
index bcbe4388c3..092177d315 100644
--- a/actionpack/test/journey/route/definition/scanner_test.rb
+++ b/actionpack/test/journey/route/definition/scanner_test.rb
@@ -30,6 +30,12 @@ module ActionDispatch
["/~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, "("],