aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/routing_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* add tests for nested lambda constraintsAaron Patterson2014-06-031-0/+27
|
* PARAMETERS_KEY is only used in the request, so move the constant thereAaron Patterson2014-05-271-5/+5
|
* just call the method and assert the return valueAaron Patterson2014-05-091-8/+1
| | | | do not test internals
* Prefer assert_raise instead of flunk + rescue to test for exceptionsCarlos Antonio da Silva2013-12-191-10/+3
| | | | | | Change most tests to make use of assert_raise returning the raised exception rather than relying on a combination of flunk + rescue to check for exception types/messages.
* Eliminate `JSON.{parse,load,generate,dump}` and `def to_json`Godfrey Chan2013-11-051-14/+15
| | | | | | | | | | | | | | | 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)
* Fix an issue where router can't recognize downcased url encoding path.kennyj2013-09-191-0/+4
|
* fix request methods testVipul A M2013-03-311-6/+2
|
* Update tests for #9704, named route collisionsJeremy Kemper2013-03-241-5/+6
| | | | | * Fix named route collision in mount test fixture * Update controller named route precedence test
* Add tests for #9441Francesco Rodriguez2013-02-261-0/+16
|
* do not append a second slash when usingYves Senn2013-01-021-6/+16
|
* Add Missing Keys from Journey on failed URL formatschneems2012-08-281-6/+6
| | | | | | | | | | | | | | | | | | | | | | | Many named routes have keys that are required to successfully resolve. If a key is left off like this: <%= link_to 'user', user_path %> This will produce an error like this: No route matches {:action=>"show", :controller=>"users"} Since we know that the :id is missing, we can add extra debugging information to the error message. No route matches {:action=>"show", :controller=>"users"} missing required keys: [:id] This will help new and seasoned developers look closer at their parameters. I've also subclassed the routing error to be clear that this error is a result of attempting to generate a url and not because the user is trying to visit a bad url. While this may sound trivial this error message is misleading and confuses most developers. The important part isn't what's in the options its's what's missing. Adding this information to the error message will make debugging much more obvious. This is the sister pull request of https://github.com/rails/journey/pull/44 which will be required to get they missing keys into the correct error message. Example Development Error in Rails: http://cl.ly/image/3S0T0n1T3421
* Access @rs only through attr_accessortomykaira2012-08-201-11/+11
|
* Support unicode character route in config/routes.rb.kennyj2012-06-161-0/+5
|
* adding a test for #6459Aaron Patterson2012-06-141-0/+10
|
* Merge pull request #2549 from trek/RoutingErrorForMissingControllersAaron Patterson2012-05-211-0/+10
|\ | | | | When a route references a missing controller, raise ActionController::RoutingError with clearer message
| * When a route references a missing controller, raise ↵Trek Glowacki2011-08-161-0/+10
| | | | | | | | ActionController::RoutingError with a clearer message
* | Force given path to http methods in mapper to skip canonical action checkingCarlos Antonio da Silva2012-05-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following scenario: resources :contacts do post 'new', action: 'new', on: :collection, as: :new end Where the /new path is not generated because it's considered a canonical action, part of the normal resource actions: new_contacts POST /contacts(.:format) contacts#new Fixes #2999
* | ActionPack: remove tests for hash_for_* methodsBogdan Gusiev2012-05-021-18/+0
| |
* | Remove default match without specified methodJose and Yehuda2012-04-241-168/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Route root helper shortcutBrian Cardarella2012-03-031-0/+9
| | | | | | | | Allow the root route helper to accept just a string
* | Optimize url helpers.Sergey Nartimov + José Valim2012-03-021-3/+3
| |
* | Adding tests for non-optional glob parametersAndrew White2012-02-261-2/+27
| |
* | Add config.default_method_for_update to support PATCHDavid Lee2012-02-221-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PATCH is the correct HTML verb to map to the #update action. The semantics for PATCH allows for partial updates, whereas PUT requires a complete replacement. Changes: * adds config.default_method_for_update you can set to :patch * optionally use PATCH instead of PUT in resource routes and forms * adds the #patch verb to routes to detect PATCH requests * adds #patch? to Request * changes documentation and comments to indicate support for PATCH This change maintains complete backwards compatibility by keeping :put as the default for config.default_method_for_update.
* | adding tests to document behavior for #4817Aaron Patterson2012-02-141-0/+26
| |
* | Cleaning Route generation testsThiago Pradi2012-02-121-30/+0
| |
* | Merge pull request #3775 from karevn/masterAaron Patterson2012-01-241-1/+14
|\ \ | | | | | | Please pull my changes - they fix a rare problem with tests framework
| * | Fix: when using subdomains and constraints, request params were not passed ↵karevn2011-11-281-1/+14
| |/ | | | | | | to constraints callback
* | Added custom regexps to ASTs that have literal nodes on either side ofAaron Patterson2012-01-231-0/+62
| | | | | | | | symbol nodes. Fixes #4585
* | moved the `get` testing method to a moduleAaron Patterson2012-01-231-11/+2
| |
* | Remove rescue_action from compatibility module and testsCarlos Antonio da Silva2012-01-171-1/+0
| |
* | AP tests should inherit from AS::TestCaseAaron Patterson2012-01-051-2/+2
| |
* | remove checks for encodings availabilitySergey Nartimov2011-12-251-1/+1
| |
* | adding an integration test for splat regexp substitutions. fixes #4138Aaron Patterson2011-12-221-0/+13
| |
* | Adding an integration test. Fixes #4136Aaron Patterson2011-12-221-0/+9
| |
* | rack bodies should be a listAaron Patterson2011-12-221-7/+7
| |
* | refactoring routing testsAaron Patterson2011-12-221-34/+19
| |
* | adding integration test for journey #7Aaron Patterson2011-12-211-0/+22
| |
* | caches should not be global, so no need to clear in the teardownAaron Patterson2011-12-211-4/+0
| |
* | adding tests for #4029Aaron Patterson2011-12-191-0/+51
| |
* | Named Routes shouldn't override existing ones (currently route recognition ↵Andy Jeffries2011-12-051-2/+2
| | | | | | | | goes with the earliest match, named routes use the latest match)
* | fix method redefined warnings in testslest2011-11-301-6/+0
|/
* moving test_generate to an integration test with one assert per testAaron Patterson2011-08-121-108/+0
|
* remove extra require for 'active_support/dependencies' as it is required in ↵Vishnu Atrai2011-07-311-1/+0
| | | | abstract_unit.rb
* raise an error if the old router draw method is used, along with a message ↵Josh Kalderimis2011-05-031-0/+6
| | | | advising them to either upgrade their routes or add rails_legacy_mapper to their Gemfile
* Action Pack typos.R.T. Lechow2011-03-051-1/+1
|
* cleaning up some warnings on 1.9.3Aaron Patterson2011-02-071-2/+2
|
* The redirect routing method now allows for a hash of options which only ↵Josh Kalderimis2010-11-301-284/+297
| | | | changes the relevant parts of the url, or an object which responds to call can be supplied so common redirect rules can be easily reused. This commit includes a change where url generation from parts has been moved to AD::Http::URL as a class method.
* Revert "Quick fix for not escaping []s (not ideal)"Santiago Pastorino2010-11-181-3/+3
| | | | | | | | | According to http://www.ietf.org/rfc/rfc2616.txt and http://tools.ietf.org/rfc/rfc3986.txt [ and ] are reserved characters and should be escaped using "%" HEX HEX This reverts commit 856d2fd874d72dd9f83204affff4edfef3308361 and 1ee9b40b18a0bed5bb10a0785f7e2730bac983f6..
* Anchors should be allowed on constraints that are not on path segmentsCarl Lerche2010-11-161-0/+8
|
* Remove deprecated stuff in ActionControllerCarlos Antonio da Silva2010-09-261-7/+7
| | | | | | This removes all deprecated classes in ActionController related to Routing, Abstract Request/Response and Integration/IntegrationTest. All tests and docs were changed to ActionDispatch instead of ActionController.