aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/journey/router_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* use the mapper to build the routing tableAaron Patterson2015-08-151-200/+89
| | | | | | 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-141-5/+6
| | | | | The outer router object already keeps a hash of named routes, so we should just use that.
* rm add_route2Aaron Patterson2015-08-141-26/+32
| | | | | 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-131-30/+23
| | | | | 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-131-22/+22
| | | | | 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-081-26/+26
| | | | | this way we can remove the strange "respond_to?" conditional in the `matches?` loop
* 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
* 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 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.
* remove warningsKuldeep Aggarwal2014-06-121-2/+0
| | | | warning: assigned but unused variable - scope_called, path and strexp
* Path::Pattern is instantiated internally, so make the contructor require a ↵Aaron Patterson2014-05-291-15/+19
| | | | strexp object
* add an alternate constructor to Strexp that takes a stringAaron Patterson2014-05-291-16/+16
|
* 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-201-1/+12
| | | | | | | | | | | | | | | | | | | | | | 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.
* 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
* 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-311-1/+1
|
* Alias refute methods to assert_not and perfer assert_not on testsRafael Mendonça França2012-12-311-1/+1
|
* Integrate Journey into Action DispatchAndrew White2012-12-191-0/+575
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.