aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/journey
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Eliminate `JSON.{parse,load,generate,dump}` and `def to_json`Godfrey Chan2013-11-051-2/+2
| | | | | | | | | | | | | | | JSON.{dump,generate} offered by the JSON gem is not compatiable with Rails at the moment and can cause a lot of subtle bugs when passed certain data structures. This changed all direct usage of the JSON gem in internal Rails code to always go through AS::JSON.{decode,encode}. We also shouldn't be implementing `to_json` most of the time, and these occurances are replaced with an equivilent `as_json` implementation to avoid problems down the road. See [1] for all the juicy details. [1]: intridea/multi_json#138 (comment)
* Correct error in Utils.normalize_path that changed paths improperlyJosh Symonds2013-10-231-0/+8
|
* Skip Rack applications and redirects when generating urlsAndrew White2013-07-161-9/+13
| | | | | | | | | | When generating an unnamed url (i.e. using `url_for` with an options hash) we should skip anything other than standard Rails routes otherwise it will match the first mounted application or redirect and generate a url with query parameters rather than raising an error if the options hash doesn't match any defined routes. Fixes #8018
* Make ActionDispatch::Journey::Path::Pattern#new raise more meaningful ↵zires2013-02-271-0/+4
| | | | exception message.
* Change the behavior of route defaultsAndrew White2013-01-151-5/+8
| | | | | | | | | | | | | | | | | | | This commit changes route defaults so that explicit defaults are no longer required where the key is not part of the path. For example: resources :posts, bucket_type: 'posts' will be required whenever constructing the url from a hash such as a functional test or using url_for directly. However using the explicit form alters the behavior so it's not required: resources :projects, defaults: { bucket_type: 'projects' } This changes existing behavior slightly in that any routes which only differ in their defaults will match the first route rather than the closest match. Closes #8814
* Raise correct exception now Journey is integrated.Andrew White2013-01-151-4/+4
| | | | | | | Now that Journey has been integrated into ActionDispatch we can raise the exception ActionController::UrlGenerationError directly rather than raising the internal Journey::Router::RoutingError and then have ActionDispatch::Routing::RouteSet#generate re-raise the exception.
* Use ActiveSupport::TestCase in the journey testsRafael Mendonça França2012-12-3113-13/+13
|
* Alias refute methods to assert_not and perfer assert_not on testsRafael Mendonça França2012-12-317-17/+17
|
* Integrate Journey into Action DispatchAndrew White2012-12-1913-0/+1615
Move the Journey code underneath the ActionDispatch namespace so that we don't pollute the global namespace with names that may be used for models. Fixes rails/journey#49.