aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/journey
Commit message (Collapse)AuthorAgeFilesLines
* Remove TestRouter#add_routesakihiro172015-09-291-11/+0
| | | | | | Now, we use the mapper to build the routing table related to https://github.com/rails/rails/commit/703275ba70efbefb3358052b6ba750443eff1a28
* File encoding is defaulted to utf-8 in Ruby >= 2.1Akira Matsuda2015-09-181-1/+0
|
* symbols will always be constructed with strings. :bomb:Aaron Patterson2015-08-181-1/+1
|
* routes are always constructed with a hash for the conditionsAaron Patterson2015-08-171-1/+1
|
* introduce an alternate constructor for Route objectsAaron Patterson2015-08-171-12/+12
| | | | | I want to change the real constructor to take a particular parameter for matching the request method
* default pattern to use a joined stringAaron Patterson2015-08-172-13/+15
| | | | | The string we create is almost always the same, so rather than joining all the time, lets join once, then reuse that string everywhere.
* use the mapper to build the routing tableAaron Patterson2015-08-152-231/+103
| | | | | | We should build the routes using the user facing API which is `Mapper`. This frees up the library internals to change as we see fit. IOW we shouldn't be testing internals.
* only keep one hash of named routesAaron Patterson2015-08-142-13/+14
| | | | | The outer router object already keeps a hash of named routes, so we should just use that.
* rm add_route2Aaron Patterson2015-08-142-41/+51
| | | | | refactor the tests with a backwards compatible method call so we can rm add_route2 from the journey router
* use predicate methods instead of hard coding verb stringsAaron Patterson2015-08-141-5/+4
| | | | | also change the feeler to subclass AD::Request so that it has all the methods that Request has
* remove StrexpAaron Patterson2015-08-134-74/+61
| | | | | This was a useless object. We can just directly construct a Path::Pattern object without a Strexp object.
* pass anchor directly to `Pattern`Aaron Patterson2015-08-134-39/+38
| | | | | the caller already has it, there is no reason to pack it in to an object and just throw that object away.
* Revert "Merge pull request #20584 from arthurnn/fix_url"Arthur Neves2015-06-171-7/+0
| | | | | | | | This reverts commit 0b3397872582f2cf1bc6960960a6393f477c55e6, reversing changes made to 56d52e3749180e6c1dcf7166adbad967470aa78b. As pointed out on the PR, this will hide development mistakes too, which is not ideal.
* Catch InvalidURIError on bad paths on redirect.Arthur Neves2015-06-161-0/+7
| | | | | Handle URI::InvalidURIError errors on the redirect route method, so it wont raise a 500 if a bad path is given.
* extract required_defaults from the conditions hash before constructing the routeAaron Patterson2015-06-083-48/+48
| | | | | this way we can remove the strange "respond_to?" conditional in the `matches?` loop
* Prefer assert_not over refuteRafael Mendonça França2015-05-181-1/+1
|
* ActionDispatch::Journey::Routes#empty? test casesValentine Valyaeff2015-05-191-0/+2
|
* Silence ambiguous first argument warningPrem Sichanugrist2015-05-041-1/+1
| | | | | | | This silences: actionpack/test/journey/route_test.rb:33: warning: ambiguous first argument; put parentheses or a space even after `/' operator
* Merge pull request #18392 from brainopia/fix_route_requirementsArthur Nogueira Neves2015-04-271-0/+8
|\ | | | | Correct route requirements by overriding defaultls
| * Correct route requirements by overriding defaultls (fixes #18373)brainopia2015-01-081-0/+8
| |
* | sort_by instead of sortYang Bo2015-04-081-0/+27
| | | | | | | | | | | | it is avoid sort errot within different and mixed keys. used `sort_by` + `block` to list parameter by keys. keep minimum changes
* | Merge pull request #15806 from tgxworld/partition_routes_during_setupAaron Patterson2015-03-021-0/+21
|\ \ | | | | | | Partition routes during setup.
| * | Partition routes during setup.Guo Xiang Tan2015-02-261-0/+21
| | | | | | | | | | | | | | | | | | | | | Partitioning of all the routes is currently being done during the first request. Since there is no need to clear the cache for `partitioned_routes` when adding a new route. We can move the partitioning of the routes during setup time.
* | | Remove unneeded comment. [ci skip]Zoltan Kiss2015-03-021-1/+0
|/ /
* / Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
|/ | | | onwards.
* make OR in journey patterns compile to a valid regular expressionKonstantin Haase2014-11-291-0/+2
|
* Fix cases where the wrong name is passed to `Formatter#generate`Godfrey Chan2014-11-231-1/+1
| | | | | These are currently working "by accident" because `match_route` does not check that the name is valid.
* fix url generation error messageAccessd2014-10-211-0/+10
|
* Improve Journey compliance to RFC 3986Nicolas Cavigneaux2014-10-141-6/+19
| | | | | | | | | | The scanner in Journey fails to recognize routes that use literals from the sub-delims section of RFC 3986. This commit enhance the compatibility of Journey with the RFC by adding support of authorized delimiters to the scanner. Fix #17212
* Improve router test.Guo Xiang Tan2014-08-211-6/+11
| | | | | We should assert that routes will not be recognized if the verbs do not match.
* Avoid duplicating routes for HEAD requests.Guo Xiang Tan2014-08-211-1/+20
| | | | | | | | Follow up to rails#15321 Instead of duplicating the routes, we will first match the HEAD request to HEAD routes. If no match is found, we will then map the HEAD request to GET routes.
* Force encoding of US-ASCII to UTF-8 in unescape_uri.Karl Entwistle2014-07-101-0/+5
| | | | | | | | | Because URI paths may contain non US-ASCII characters we need to force the encoding of any unescaped URIs to UTF-8 if they are US-ASCII. This essentially replicates the functionality of the monkey patch to URI.parser.unescape in active_support/core_ext/uri.rb. Fixes #16104.
* remove warningsKuldeep Aggarwal2014-06-121-2/+0
| | | | warning: assigned but unused variable - scope_called, path and strexp
* no more is_a checks on instantiationAaron Patterson2014-05-291-4/+0
|
* Path::Pattern is instantiated internally, so make the contructor require a ↵Aaron Patterson2014-05-294-39/+43
| | | | strexp object
* Strexp#names is only used in a test, so rmAaron Patterson2014-05-291-32/+0
|
* add an alternate constructor to Strexp that takes a stringAaron Patterson2014-05-294-31/+31
|
* Remove TODO.Guo Xiang Tan2014-05-281-11/+1
|
* pass the request object to the applicationAaron Patterson2014-05-251-2/+5
|
* push is_a?(Dispatcher) check in to one placeAaron Patterson2014-05-241-0/+1
|
* glob_param is never used, so rmAaron Patterson2014-05-231-1/+5
| | | | | | this also changes the constructor. We don't need to pass more options than "defaults" (whatever defaults are, ugh. probably another hash of stupid stuff).
* decouple the router object from the request classAaron Patterson2014-05-231-14/+6
|
* pass the correct custom request to the recognize methodAaron Patterson2014-05-231-13/+10
|
* switch to the `serve` method so we can remove the request class (eventually)Aaron Patterson2014-05-231-2/+6
|
* remove NullRequest and just always pass a request classAaron Patterson2014-05-231-3/+7
|
* use the request object since we have itAaron Patterson2014-05-231-1/+3
| | | | | stop hardcoding hash keys and use the accessors provided on the request object.
* middle variable is never used, so rmAaron Patterson2014-05-211-14/+14
|
* we don't use this parameter for anything, so rmAaron Patterson2014-05-201-20/+19
|
* Make URL escaping more consistentAndrew White2014-04-202-1/+16
| | | | | | | | | | | | | | | | | | | | | | 1. Escape '%' characters in URLs - only unescaped data should be passed to URL helpers 2. Add an `escape_segment` helper to `Router::Utils` that escapes '/' characters 3. Use `escape_segment` rather than `escape_fragment` in optimized URL generation 4. Use `escape_segment` rather than `escape_path` in URL generation For point 4 there are two exceptions. Firstly, when a route uses wildcard segments (e.g. *foo) then we use `escape_path` as the value may contain '/' characters. This means that wildcard routes can't be optimized. Secondly, if a `:controller` segment is used in the path then this uses `escape_path` as the controller may be namespaced. Fixes #14629, #14636 and #14070.
* Always escape string passed to url helper.edogawaconan2014-04-201-2/+2
| | | | | | | | | | Makes it clear that anything passed with the helper must not be percent encoded. Fixes previous behavior which tricks people into believing passing non-percent-encoded will generate a proper percent-encoded path while in reality it doesn't ('%' isn't escaped). The intention is nice but the heuristic is broken.