aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/base_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* WIP: Remove the global routerCarlhuda2010-02-251-1/+3
|
* Make filter parameters based on request, so they can be modified for ↵José Valim2010-01-211-2/+19
| | | | anything in the middleware stack.
* Ensure that segments in default_url_options also work with format specified.José Valim2010-01-071-0/+8
|
* From now on, parameters defined in default_url_options can be absent from ↵José Valim2010-01-071-43/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | named routes. This allows the following setup to work: # app/controllers/application_controller.rb class ApplicationController def default_url_options(options=nil) { :locale => I18n.locale } end end # From your views and controllers: I18n.locale #=> :en users_url #=> "/en/users" users_url(:pl) #=> "/pl/users" user_url(1) #=> "/en/users/1" user_url(:pl, 1) #=> "/pl/users/1" user_url(1, :locale => :pl) #=> "/pl/users/1" If you provide all expected parameters, it still works as previously. But if any parameter is missing, it tries to assign all possible ones with the hash returned in default_url_options or the one passed straight to the named route method. Beware that default_url_options in ApplicationController is not shared with ActionMailer, so you are required to always give the locale in your email views.
* Remove duplicated url_for code and move methods shared between ActionMailer ↵José Valim2010-01-071-1/+0
| | | | and ActionController up to AbstractController.
* Remove ActionView inline logging to ActiveSupport::Notifications and create ↵José Valim2009-12-261-7/+0
| | | | ActionController::Base#log_event, so everything can be logged within one listener. Also expose log_process_action as a hook for different modules to include their own information during the action processing. This allow ActiveRecord to hook and any other ORM. Finally, this commit changes 'Processing' and 'Rendering' in logs to 'Processed' and 'Rendered' because at the point it's logged, everying already happened.
* Use new routing dsl in testsJoshua Peek2009-12-081-3/+3
|
* Start rewriting some internal tests to use the new routing dslJoshua Peek2009-10-201-12/+12
|
* Cleanup route reloading in tests. Prefer with_routing over using ↵Joshua Peek2009-08-161-17/+17
| | | | ActionController::Routing::Routes directly
* Cleaning up more tests and code that needed to work in both old and new baseYehuda Katz + Carl Lerche2009-06-171-5/+1
|
* Document and clean up HideActions and HttpYehuda Katz + Carl Lerche2009-06-101-3/+8
|
* Got new base to pass controller/base_test.rb, implemented method_missing ↵Yehuda Katz + Carl Lerche2009-05-141-1/+1
| | | | action semantics in compatibility mode, and fixed a few action_missing bugs.
* Cherry-pick core extensionsJeremy Kemper2009-05-131-0/+1
|