aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/routing_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Finish moving config.frameworks-dependent code to the framework pluginCarlhuda2009-12-231-0/+2
|
* Make /rails/info/properties work again. Also, the mocked up tests were ↵Carlhuda2009-12-231-0/+5
| | | | passing so we added a test that actually tested this functionality.
* Isolation tests intentionally avoid loading any state (because they're often ↵Carlhuda2009-12-231-3/+3
| | | | testing things that have their own load path semantics that should not be polluted), so rack/test is not yet on the load path. Moving require "rack/test" into the setup means and after boot_rails means that it'll be required after the laod path has been altered to add in the Rails vendor/gems
* Merge branch 'master' of github.com:rails/railsJoshua Peek2009-12-211-7/+7
|\ | | | | | | | | | | Conflicts: railties/test/initializer/initialize_i18n_test.rb railties/test/initializer/path_test.rb
* | Update routes.rb template to use App nameJoshua Peek2009-12-211-7/+7
|/
* Default route was removed from default route config, patch up failing tests.Joshua Peek2009-12-211-0/+18
|
* Procs don't call themselvesJoshua Peek2009-12-151-0/+32
| | | | Fixes dev mode reloading [#3574 state:resolved]
* Fix loading plugin and engine route setsJoshua Peek2009-12-141-0/+38
|
* Some basic route discovery testsJoshua Peek2009-12-011-0/+85