aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/journey
Commit message (Collapse)AuthorAgeFilesLines
* Show an "unmatched constraints" error for mismatching and present paramsChris Carter2016-10-031-1/+1
| | | | | | | | | | | | Currently a misleading "missing required keys" error is thrown when a param fails to match the constraints of a particular route. This commit ensures that these params are recognised as unmatching rather than missing. Note: this means that a different error message will be provided between optimized and non-optimized path helpers, due to the fact that the former does not check constraints when matching routes. Fixes #26470.
* Add three new rubocop rulesRafael Mendonça França2016-08-165-26/+26
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* Fix broken alignments caused by auto-correct commit 411ccbdRyuta Kamizono2016-08-101-2/+4
| | | | Hash syntax auto-correcting breaks alignments. 411ccbdab2608c62aabdb320d52cb02d446bb39c
* applies remaining conventions across the projectXavier Noria2016-08-067-13/+13
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-064-65/+65
|
* remove redundant curlies from hash argumentsXavier Noria2016-08-062-25/+21
|
* modernizes hash syntax in actionpackXavier Noria2016-08-063-79/+79
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-0612-354/+354
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Deprecate :controller and :action path parametersAndrew White2016-03-011-61/+69
| | | | | | | | Allowing :controller and :action values to be specified via the path in config/routes.rb has been an underlying cause of a number of issues in Rails that have resulted in security releases. In light of this it's better that controllers and actions are explicitly whitelisted rather than trying to blacklist or sanitize 'bad' values.
* 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).