aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/mapper_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-4/+4
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* modernizes hash syntax in actionpackXavier Noria2016-08-061-15/+15
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-22/+22
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix setting route's to in a scopePiotr Jakubowski2016-06-281-0/+12
| | | | | | Fixes #25488 97d7dc4 introduced a regression that resulted in ArgumentError when to was in options of the scope and not of particular route.
* Do not destructively mutate passed options hash in route definitionsSam Davies2016-03-031-0/+13
| | | | | | | | | | | | | | | | | | | | - Fixes #24030 An example scope might be specified as such: ```ruby HTML = { constraints: { format: :html } }.freeze scope HTML do get 'x' end ``` This currently raises an error because the mapper attempts to destructively modify the passed options hash. This is dangerous because this options hash might even be shared with other scopes. We should instead always instantiate a new object instead of modifying the passed options.
* Brush up errors of `ActionDispatch::Routing::Mapper#mount`yui-knk2015-11-281-1/+13
| | | | | | * Integrate to raise `ArgumentError` * Detailed error message when `path` is not defined * Add a test case, invalid rack app is passed
* Change `Journey::Route#verb` to return string instead of regexp.yui-knk2015-10-031-2/+2
| | | | | | | | | By [this commit](https://github.com/rails/rails/commit/0b476de445faf330c58255e2ec3eea0f3a7c1bfc) `Journey::Route#verb` need not to return verb as regexp. The returned value is used by inspector, so change it to be a string. Add inspect_with_multiple_verbs test case to keep the behavior of inspector correctly.
* routes are always constructed with a hash for the conditionsAaron Patterson2015-08-171-2/+2
|
* pass pass the mapping object down the add_route stackAaron Patterson2015-08-141-1/+1
| | | | | then we can let the mapping object derive stuff that the Route object needs.
* pass the mapping object to build_routeAaron Patterson2015-08-141-16/+5
| | | | | now that we aren't doing options manipulations, we can just pass the mapping object down and read values from it.
* pass the path ast downAaron Patterson2015-08-141-1/+1
| | | | | now we don't need to add it to a hash and delete it from the hash later just to pass it around
* pull up path parsingAaron Patterson2015-08-141-1/+2
| | | | | `add_route` needs the AST, so rather than shove it in a hash and delete later, lets move parsing up the stack so we can pass down later
* implement `requirements` in terms of routesAaron Patterson2015-08-141-1/+1
|
* implement the `asts` method in terms of paths / patternsAaron Patterson2015-08-141-12/+11
| | | | Eventually I want to eliminate the FakeSet test class
* extract ast finding to a methodAaron Patterson2015-08-141-9/+13
| | | | | I'm going to reimplement this using route objects, so it will be easier if we just change ast access to go through a method rather than hashes
* stop adding path_info to the conditions hashAaron Patterson2015-08-141-9/+9
| | | | we don't need to keep adding it and deleting if from hashes.
* pull up options_constrants extractionAaron Patterson2015-08-131-1/+1
|
* remove `as`Aaron Patterson2015-08-131-1/+1
| | | | the caller already has access to `as`, so we can stop passing it around.
* remove anchor from mappingAaron Patterson2015-08-131-1/+1
| | | | | | the same value that is extracted from the options hash earlier is returned, so we don't need to pass it in in the first place. The caller already has the data, so stop passing it around.
* pull `anchor` extraction upAaron Patterson2015-08-131-1/+1
| | | | | this way we don't have to mutate the options hash so far away from where the user passed it in
* raise if `anchor` is passed to `scope`Aaron Patterson2015-08-131-0/+9
| | | | | | The `anchor` parameter [is overridden](https://github.com/rails/rails/blob/b4b4a611d0eb9aa1c640c5f521c6a43bf2a65bab/actionpack/lib/action_dispatch/routing/mapper.rb#L1528) unless it is directly passed to `match`, so setting it in a scope must be a mistake.
* pull `formatted` up the stackAaron Patterson2015-08-121-1/+10
| | | | this reduces the number of times we have to mutate the options hash.
* add a regression test for scoped `format` paramsAaron Patterson2015-08-121-0/+11
| | | | This just ensures that `format` is applied to things inside the scope
* add a regression test for adding arbitrary keys to `scope`Aaron Patterson2015-08-121-0/+15
|
* add a method to `Scope` for getting mapping optionsAaron Patterson2015-08-121-1/+2
| | | | | Eventually we don't want to expose the "options" hash from scope, only read values from it. Lets start by adding a reader method.
* pull `via` all the way out of `add_route`Aaron Patterson2015-08-121-0/+8
|
* add a test for adding "via" using `scope`Aaron Patterson2015-08-121-0/+9
|
* pull `via` extraction upAaron Patterson2015-08-121-2/+2
| | | | | | We're going to try pulling this up further, and check `via` validity sooner. This way we don't have to do a bunch of processing on `options` hashes only to find out that the route is incorrect
* pull `to` upAaron Patterson2015-08-111-1/+1
| | | | | this way we don't have to insert / delete it from the options hash so many times.
* push option decomposition up a bit moreAaron Patterson2015-08-111-2/+2
| | | | | I think we can find the original place where `action` is added to the options hash now.
* pull up the "options.delete(:controller)" logicAaron Patterson2015-08-111-2/+2
| | | | | | we want to try to pull this logic up to where the user actually passed in "controller" so that it's close to the related call. That way when we're down the stack, we don't need to wonder "why are we doing this?"
* Allow a custom dispatcher to be provided to routing.Xavier Shay2015-08-071-0/+4
|
* fewer operations on the options hashAaron Patterson2014-08-131-1/+1
| | | | | since we pass `as` down, then we won't have to do an insert / delete dance with the options hash
* RouteSet should be in charge of constructing the dispatherAaron Patterson2014-07-151-2/+2
| | | | Now we can override how requests are dispatched in the routeset object
* use the factory method to construct the mappingAaron Patterson2014-06-031-1/+1
|
* Mapping never actually uses @set, so rmAaron Patterson2014-05-291-1/+1
|
* use a parser to extract the group parts from the pathAaron Patterson2014-05-291-2/+2
|
* Raise a helpful error message on #mount misuseCarl Lerche2012-07-101-0/+9
|
* Remove more tests related to draw external routes filesRafael Mendonça França2012-06-291-2/+1
| | | | Related with 5e7d6bba79393de0279917f93b82f3b7b176f4b5
* Fix the buildYehuda Katz2012-04-251-1/+2
|
* Remove default match without specified methodJose and Yehuda2012-04-241-8/+8
| | | | | | | | | | | | | | | | In the current router DSL, using the +match+ DSL method will match all verbs for the path to the specified endpoint. In the vast majority of cases, people are currently using +match+ when they actually mean +get+. This introduces security implications. This commit disallows calling +match+ without an HTTP verb constraint by default. To explicitly match all verbs, this commit also adds a :via => :all option to +match+. Closes #5964
* all routes can be stored in the Journey Routes objectAaron Patterson2011-09-121-0/+1
|
* fixing wildcard path matching when wildcard is inside parenthesisAaron Patterson2011-07-261-0/+7
|
* Allow a route to have :format => trueErik Michaels-Ober2011-07-251-0/+7
| | | | | | When format is true, it is mandatory (as opposed to :format => false). This is currently not possible with resource routes, which automatically make format optional by default.
* Remove 'warning: ambiguous first argument' when running ActionPack testsSebastian Martinez2011-03-291-2/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Move mapper_test to the appropriate locationPrem Sichanugrist2011-03-291-0/+88
It seems like in 89c5b9aee7d7db95cec9e5a934c3761872ab107e Aaron actually put the test in action_dispatch folder. However, there's already a `test/dispatch` directory which I think it's more appropriate. Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>