aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/base_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Don't handle params option in a special way in url_for helper"Rafael Mendonça França2019-01-161-1/+1
| | | | | | | | | | | This reverts commit e385e4678fc64be6e176c3bdac6641db9fe48d85. While this option was undocumented it exists to make possible to pass parameters to the route helpers that are reserved like `:domain`. While `url_for(domain: 'foo.com')` would generate a URL in the `foo.com` domain `url_for(params: { domain: 'foo.com' })` would generate a URL with `?domain=foo.com`.
* Merge pull request #33256 from ilkkao/ilkkao/remove-unused-params-optionRyuta Kamizono2018-10-011-1/+1
|\ | | | | | | Don't handle params option in a special way in url_for helper
| * Don't handle params option in a special way in url_for helperIlkka Oksanen2018-08-201-1/+1
| |
* | Change the empty block style to have space inside of the blockRafael Mendonça França2018-09-251-1/+1
|/
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-251-2/+2
|
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Do not include default response headers for AC::MetalJon Moss2017-03-291-0/+27
| | | | | | | | | | | | In Rails 4.2, `ActionController::Metal` controllers did not include the default headers from `ActionDispatch::Response`. However, through e16afe6, and a general shift towards having `ActionController::Metal` objects contain `ActionDispatch::Response` objects (instead of just returning an array of status, headers, and body), this behavior was lost. This PR helps to restore the original behavior by having `ActionController::Metal` controllers generate Response objects without the default headers, while `ActionController::Base` now overrides the factory method to make sure its version does have the default headers.
* improve error message when include assertions failMichael Grosser2016-09-161-1/+1
| | | | | | assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-16/+16
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-44/+44
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Deprecate :controller and :action path parametersAndrew White2016-03-011-3/+12
| | | | | | | | Allowing :controller and :action values to be specified via the path in config/routes.rb has been an underlying cause of a number of issues in Rails that have resulted in security releases. In light of this it's better that controllers and actions are explicitly whitelisted rather than trying to blacklist or sanitize 'bad' values.
* Push `before_sending` to super classeileencodes2015-12-061-1/+1
| | | | | | | | | | | | We want to get rid of the `Live::Response` so we are consolidating methods from `Live::Response` and `Response` by merging them together. This adds an `#empty` method to the request so we don't need to hard-code the empty array each time we call an empty `ActionDispatch::Request`. The work here is a continuation on combining controller and integration test code bases into one.
* provide a request and response to all controllersAaron Patterson2015-08-251-0/+2
| | | | | | | | | | Controllers should always have a request and response when responding. Since we make this The Rule(tm), then controllers don't need to be somewhere in limbo between "asking a response object for a rack response" or "I, myself contain a rack response". This duality leads to conditionals spread through the codebase that we can delete: * https://github.com/rails/rails/blob/85a78d9358aa728298cd020cdc842b55c16f9549/actionpack/lib/action_controller/metal.rb#L221-L223
* 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`.
* let the superclass build the request and responseAaron Patterson2015-07-081-2/+0
| | | | | We should leverage the request / response objects that the superclass has already allocated for us.
* Deprecate `:nothing` option for render methodMehmet Emin İNAÇ2015-05-281-2/+2
| | | | `head` method works similar to `render` method with `:nothing` option
* 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-3/+3
| | | | | | | | 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
* Preserve default url options when generating URLsTekin Suleyman2015-01-281-0/+21
| | | | | Fixes an issue that would cause default_url_options to be lost when generating URLs with fewer positional arguments than parameters in the route definition.
* Remove ActionController::HideActions (closes #18336)brainopia2015-01-061-38/+1
|
* Expectations firstAkira Matsuda2014-08-181-1/+1
|
* Remove ActionController::RecordIdentifier was deprecated.kennyj2013-06-011-29/+3
|
* Fix broken ActionController#action_missingJanko Luin2013-03-201-0/+12
| | | | | A recent change introduced the assumption that all controller actions are known beforehand, which is not true when using action_missing.
* Deprecate AV::RecordIdentifier in controllersPiotr Sarnacki2012-08-281-0/+41
| | | | | | | | Methods provided by RecordIdentifier are not widely used in controllers nowadays as they're view specific (this is probably a legacy left after RJS rendering directly in controllers). However if people still need to use it, it's trivial to include ActionView::RecordIdentifier by themselves.
* Remove default match without specified methodJose and Yehuda2012-04-241-7/+7
| | | | | | | | | | | | | | | | 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
* default_url_options does not receive one argument anymoreRafael Mendonça França2012-04-081-1/+1
|
* Remove ActionController::TestCase#rescue_action_in_public!Piotr Sarnacki2012-03-151-5/+0
| | | | | | This method has no effect since exception handling was moved to middlewares and ActionController tests do not use any middlewares.
* @controller already includes url_helpers in with_routing methodSantiago Pastorino2012-03-101-1/+0
|
* Optimize url helpers.Sergey Nartimov + José Valim2012-03-021-4/+4
|
* Added unit test to cover changes to RouteSet.url_forRyan McGeary2012-02-071-0/+16
| | | | | | | | | ActionDispatch::Routing::RouteSet.url_for now handles passing params through to ActionDispatch::Http::Url.url_for Conflicts: actionpack/test/controller/base_test.rb
* Do not deprecate performed.José Valim2012-01-191-0/+6
|
* Remove method missing handling when action is not found, use action missing ↵Carlos Antonio da Silva2012-01-171-45/+0
| | | | | | | instead Do not create a method_missing method to handle not found actions, use the action_missing method provided by Rails instead.
* Remove other old compatibility constantsCarlos Antonio da Silva2012-01-171-2/+2
|
* AP tests should inherit from AS::TestCaseAaron Patterson2012-01-051-1/+1
|
* Moving to logger methods to ActiveSupport LoggerKarunakar (Ruby)2011-12-241-2/+2
|
* Removed deprecated RouteSet API, still many tests failPiotr Sarnacki2010-09-051-1/+1
|
* Remove deprecated support to <% form_for %> and several ↵José Valim2010-08-291-14/+0
| | | | ActionController::Base methods.
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-6/+6
| | | | 's/[ \t]*$//' -i {} \;)
* Move Rails module to abstract_unit to make test in isolation workSantiago Pastorino2010-06-281-3/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Missing method error doesn't specify which controller it is missing from ↵Alan Harper2010-06-101-1/+10
| | | | | | | | | [#4436 state:resolved] The error page shown when the method you are requesting on a controller doesn't specify which controller the method is missing from Signed-off-by: José Valim <jose.valim@gmail.com>
* Tests method_missing to raise NameError. [#2522 state:resolved]Rizwan Reza2010-03-271-0/+16
| | | Signed-off-by: wycats <wycats@gmail.com>
* Current url helpers become actions in controller. Added a failing test case ↵José Valim2010-03-221-6/+17
| | | | for it.
* Reinstate dom_id in controllers.Justin Ko2010-03-091-0/+8
| | | | | | | [#3040 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com> Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Reinstate default_url_options and remove url_options= writerJeremy Kemper2010-03-081-23/+19
|
* Silence test deprecation warningsCarlhuda2010-02-261-16/+55
|
* Fix controller_path returnsing an empty string in Ruby 1.8.7 [#4036 ↵José Valim2010-02-261-0/+9
| | | | status:resolved]
* Continued effort to deglobalize the routerCarlhuda2010-02-251-0/+1
|