aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/url_generation_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Stop using deprecated `render :text` in testPrem Sichanugrist2015-07-171-1/+1
| | | | | | | | | This will silence deprecation warnings. Most of the test can be changed from `render :text` to render `:plain` or `render :body` right away. However, there are some tests that needed to be fixed by hand as they actually assert the default Content-Type returned from `render :body`.
* Consistent usage of spaces in hashes across our codebaseRafael Mendonça França2015-01-291-1/+1
|
* Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-291-2/+2
| | | | | | | | Non-kwargs requests are deprecated now. Guides are updated as well. `post url, nil, nil, { a: 'b' }` doesn't make sense. `post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
* always test against a routed rack app so there are always url_helpersAaron Patterson2014-07-071-1/+3
|
* Merge pull request #14986 from dlangevin/trailing-slash-url-generationRafael Mendonça França2014-05-241-0/+18
|\ | | | | | | | | | | | | Fixes URL generation with trailing_slash: true Conflicts: actionpack/lib/action_dispatch/http/url.rb
| * Fixes URL generation with trailing_slash: trueDan Langevin2014-05-221-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | URL generation with trailing_slash: true was adding a trailing slash after .:format Routes.draw do resources :bars end bars_url(trailing_slash: true, format: 'json') # => /bars.json/ This commit removes that extra trailing slash
* | Always use the provided port for protocol relative urlsAndrew White2014-05-111-0/+12
|/ | | | | There may be situations where you need to tunnel SSL connections over port 80 so we shouldn't remove it if it has been explicitly provided.
* Spelling and Grammar check [ci skip]Akshay Vishnoi2013-12-161-1/+1
|
* Refactor ActionDispatch::Http::URL.build_host_urlAndrew White2013-04-181-0/+41
| | | | | Add support for extracting the port from the :host option and for removing the subdomain by using nil, false or ''.
* Fix improperly configured host in generated urlsschneems2013-03-191-0/+8
| | | | | | | | | | | | | | | | | | | If the host in `default_url_options` is accidentally set with a protocol such as ``` host: "http://example.com" ``` then the generated url will have the protocol twice `http://http://example.com` which is not what the user intended. Likely they wanted to define a host `host: "example.com"` and a `protocol: "http://"` but did not know the convention. This may not the most common problem, but when it happens it can go undetected for a while. I accidentally added `http://` out of habit recently only to find all the links in my emails were broken after deploying a demo site to production. Rather than allow this accident go undetected, we can fix the problem in line by properly setting the protocol and host. I was able to find this related question on stack overflow: http://stackoverflow.com/questions/5878329/rails-3-devise-how-do-i-make-the-email-confirmation-links-use-secure-https-n where the answer was highly upvoted. This is based off of work in #7415 cc/ @pixeltrix ATP Action Mailer and Action Pack
* Add passing tests for generating URLs with nested SCRIPT_NAMEsJeremy Kemper2012-05-071-3/+12
|
* Remove default match without specified methodJose and Yehuda2012-04-241-1/+1
| | | | | | | | | | | | | | | | 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
* Extended url_for to handle specifying which router should be used.Piotr Sarnacki2010-09-031-0/+1
| | | | | | | A few examples: url_for Blog::Engine, :posts_path url_for Blog::Engine, @post url_for Blog::Engine, :action => "main", :controller => "index"
* Get rid of :skip_prefix options in routesPiotr Sarnacki2010-09-031-1/+1
|
* Unify routes naming by renaming router to routesPiotr Sarnacki2010-07-021-8/+8
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Swear I ran this testJeremy Kemper2010-03-151-1/+1
|
* Integration test url options should account for :protocol not just https?Jeremy Kemper2010-03-151-1/+6
|
* Remove the ability to set the mountpoint when initializing a route set.Carl Lerche2010-03-041-24/+4
|
* Tweak out url_for uses :script_name and add some testsCarl Lerche2010-03-041-0/+58