aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/routing_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Split direct method into twoAndrew White2017-02-211-4/+4
| | | | | Use a separate method called `resolve` for the custom polymorphic mapping to clarify the API.
* Prefer remove_method over undef_methodAndrew White2017-02-211-0/+58
| | | | | | Using `undef_method` means that when a route is removed any other implementations of that method in the ancestor chain are inaccessible so instead use `remove_method` which restores access to the ancestor.
* Add custom polymorphic mappingAndrew White2017-02-211-4/+98
| | | | | | | | | | | | | | | | Allow the use of `direct` to specify custom mappings for polymorphic_url, e.g: resource :basket direct(class: "Basket") { [:basket] } This will then generate the following: >> link_to "Basket", @basket => <a href="/basket">Basket</a> More importantly it will generate the correct url when used with `form_for`. Fixes #1769.
* Rename url_helper to directAndrew White2017-02-211-4/+4
|
* Add support for defining custom url helpers in routes.rbAndrew White2017-02-211-2/+33
| | | | | | | | | | | Allow the definition of custom url helpers that will be available automatically wherever standard url helpers are available. The current solution is to create helper methods in ApplicationHelper or some other helper module and this isn't a great solution since the url helper module can be called directly or included in another class which doesn't include the normal helper modules. Reference #22512.
* Remove deprecated support to :text in renderRafael Mendonça França2016-10-101-14/+14
|
* Add three new rubocop rulesRafael Mendonça França2016-08-161-1/+1
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* modernizes hash syntax in railtiesXavier Noria2016-08-061-2/+2
|
* applies new string literal convention in railties/testXavier Noria2016-08-061-89/+89
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Remove unused boot_rails method and it's usagePrathamesh Sonpatki2016-07-041-1/+0
| | | | | - The `boot_rails` method from abstract_unit.rb is empty after 2abcdfd978fdcd491576a237e8c6b. - So let's remove it and its usage.
* Fix rails/info routes for apps with globbing routeNicholas Firth-McCoy2016-06-201-0/+19
| | | | | | | | The /rails/info routes were inaccessible in apps with a catch-all globbing route, as they were being appended after the globbing route and would never be matched. See also ccc3ddb7762bae0df7e2f8d643b19b6a4769d5be.
* Introduce new welcome page for new projectsGenadi Samokovarov2016-01-261-2/+1
| | | | As requested by David in 23233.
* Fix test that was failing because of typoeileencodes2015-09-271-1/+1
| | | | | Here `app` needed to be `get` because we're getting a route. This fixes the typo so the test passes.
* Add missing routing tests for info controllerAditya Kapoor2015-09-271-0/+12
| | | | | | Vaguely related to #21605 where I proposed to remove index route since it was redirecting to the 'routes' action, but this was kept so I thought it made sense to add some tests regarding this.
* Pure rack apps can be mounted with a nameJean Boussier2014-11-291-0/+20
| | | | See https://github.com/rails/rails/commit/9b15828b5c347395b42066a588c88e5eb4e72279#commitcomment-8764492
* Revert "Match Dev/Prod parity for Index Page"Piotr Sarnacki2013-07-221-1/+1
| | | | | | | | Showing welcome page in production can expose information, which should not be visible on production if people don't override the default root route. This reverts commit b0caea29c2da9f4c8bb958019813482da297067d.
* Merge pull request #11514 from schneems/schneems/dev-prod-parity-indexPiotr Sarnacki2013-07-221-1/+1
|\ | | | | Match Dev/Prod parity for Index Page
| * Match Dev/Prod parity for Index Pageschneems2013-07-201-1/+1
| | | | | | | | | | | | | | With Rails 4 the default index page was moved from a static file `index.html` inside the `public/` folder to an internal controller/view inside of the railties gem. This was to allow use of erb in the default index page and to remove the requirement that new apps must delete a static file to make their index pages work. While this was a good change, the functionality was unexpected to developers who wish to get their apps running in production ASAP. They will create a new app `rails new my app`, start a server to verify it works, then immediately deploy the app to verify that it can start working in production. Unfortunately locally they see a page when they visit `localhost:3000` when they visit their production app they get an error page. We initially anticipated this problem in the original pull request, but did not properly anticipate the severity or quantity of people who would like this functionality. Having a default index page serves as an excellent litmus test for a passed deploy on default apps, and it is very unexpected to have a page work locally, but not on production. This change makes the default index page available in production if the developer has not over-written it by defining their own `root` path inside of routes.
* | Clear named routes when routes.rb is reloadedAndrew White2013-07-211-0/+45
|/ | | | | | | | Fix an issue where Journey was failing to clear the named routes hash when the routes were reloaded and since it doesn't overwrite existing routes then if a route changed but wasn't renamed it kept the old definition. This was being masked by the optimised url helpers so it only became apparent when passing an options hash to the url helper.
* Removing use of subclassed application constant and instead using thewangjohn2013-06-031-15/+15
| | | | | more agnostic Rails.application syntax. This means tests will be more portable, and won't rely on the existence of a particular subclass.
* adding a test for root path in the appAaron Patterson2013-04-171-0/+24
|
* Clear url helper methods when routes are reloadedAndrew White2012-12-141-0/+71
| | | | | Remove all the old url helper methods when clear! is called on the route set because it's possible that some routes have been removed.
* Use Rails to Render Default Index Pageschneems2012-12-101-0/+36
| | | | | | | | | | | | | | | This is an alternative implementation to #7771 thanks to the advice of @spastorino Rails is a dynamic framework that serves a static index.html by default. One of my first questions ever on IRC was solved by simply deleting my public/index.html file. This file is a source of confusion when starting as it over-rides any set "root" in the routes yet it itself is not listed in the routes. By making the page dynamic by default we can eliminate this confusion. This PR moves the static index page to an internal controller/route/view similar to `rails/info`. When someone starts a rails server, if no root is defined, this route will take over and the "dynamic" index page from rails/welcome_controller will be rendered. These routes are only added in development. If a developer defines a root in their routes, it automatically takes precedence over this route and will be rendered, with no deleting of files required. In addition to removing this source of confusion for new devs, we can now use Rails view helpers to build and render this page. While not the primary intent, the added value of "dogfooding" should not be under-estimated. The prior PR #7771 had push-back since it introduced developer facing files. This PR solves all of the same problems, but does not have any new developer facing files (it actually removes one). cc/ @wsouto, @dickeyxxx, @tyre, @ryanb, @josevalim, @maxim, @subdigital, @steveklabnik ATP Railties and Actionpack.
* Revert "Invert precedence of content in ActionDispatch::Static"Andrew White2012-12-071-23/+0
| | | | This reverts commit c59734f756b79c39486c45273d2cc5d42cd0c864.
* Invert precedence of content in ActionDispatch::StaticAndrew White2012-12-061-0/+23
| | | | | | | | | | This commit inverts the precedence in ActionDispatch::Static so that dynamic content will be served before static content. This is so that precompiled assets do not inadvertently get included when running in development mode - it should have no effect in production where static files are usually handled by the web server. Closes #6421
* Use Ruby 1.9 Hash syntax in railtiesRobin Dupret2012-10-141-14/+14
|
* Revert "Allow loading external route files from the router"José Valim2012-06-291-83/+0
| | | | | | | | | | | | | | This reverts commit 6acebb38bc0637bc05c19d87f8767f16ce79189b. Usage of this feature did not reveal any improvement in existing apps. Conflicts: actionpack/lib/action_dispatch/routing/mapper.rb guides/source/routing.textile railties/lib/rails/engine.rb railties/lib/rails/paths.rb railties/test/paths_test.rb
* Rails::InfoController tests passingschneems2012-05-241-0/+12
| | | | This includes new tests for /rails/info/routes
* Define only writer method for queue, as reader is declaredCarlos Antonio da Silva2012-04-281-2/+0
| | | | Remove deprecation warning of method redefined.
* Routes reloader knows how to reload external filesYehuda Katz2012-04-251-0/+61
|
* Allow loading external route files from the routerJose and Yehuda2012-04-251-0/+24
| | | | | | | | | This feature enables the ability to load an external routes file from the router via: draw :filename External routes files go in +config/routes+. This feature works in both engines and applications.
* Remove default match without specified methodJose and Yehuda2012-04-241-10/+10
| | | | | | | | | | | | | | | | 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
* convert railties to use AS::TestCaseAaron Patterson2012-01-051-1/+1
|
* should be using a / in this route rather than a #Aaron Patterson2011-08-311-1/+1
|
* Solve the RAILS_ENV problem in the railties tests in a more generic wayJon Leighton2011-06-061-0/+4
|
* prepend the assets route instead of appending, closes #436José Valim2011-05-081-2/+2
|
* reload_routes! is part of the public API and should not be removed.José Valim2010-10-021-1/+8
|
* Fix a routing test. Reorganize middleware tests.José Valim2010-10-021-48/+8
|
* third parameter for rack must respond to eachAaron Patterson2010-09-221-2/+2
|
* Add RouteSet#appendCarl Lerche2010-09-171-0/+28
| | | Allows specifying blocks to the routeset that will get appended after the RouteSet is drawn.
* Fix routing testPiotr Sarnacki2010-09-111-4/+2
| | | | Signed-off-by: Mikel Lindsaar <raasdnil@gmail.com>
* Fix warning by removing |map| from routes.drawPiotr Sarnacki2010-09-081-1/+1
|
* Removed deprecated router API from railtiesPiotr Sarnacki2010-09-051-8/+8
|
* Ensure routes are loaded only after the initialization process finishes, ↵José Valim2010-09-021-0/+17
| | | | ensuring all configuration options were applied.
* Improve best_standards_support to use only IE=Edge in development modewycats2010-08-091-31/+65
|
* Add a header that tells Internet Explorer (all versions) to use the best ↵wycats2010-07-271-0/+1
| | | | | | available standards support. This ensures that IE doesn't go into quirks mode because it has been blacklisted by too many users pressing the incompatible button. It also tells IE to use the ChromeFrame renderer, if the user has installed the plugin. This guarantees that the best available standards support will be used on the client.
* Add a failing test for ticket #4874José Valim2010-06-171-0/+14
|
* nested controllers need to be explicitly declared with the new mapperJoshua Peek2010-02-281-1/+2
|
* Refactor railties test, break huge files in smaller chunks and move ↵José Valim2010-01-261-45/+33
| | | | initializers to application folder.
* Add test case for load initializers before routing behavior.Prem Sichanugrist2010-01-211-0/+28
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>