aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/test_case.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* no more HWIAAaron Patterson2015-07-101-1/+1
| | | | | non_path_parameters is used internally (it never escapes this method) so we should be able to safely use a regular hash.
* remove param dup'ing logicAaron Patterson2015-07-101-8/+0
| | | | | since we are serializing parameters, we don't need to do all the dup checks on each object.
* encode / decode parameters before assigning them to the requestAaron Patterson2015-07-101-5/+58
| | | | | | We should roundtrip the parameters through their respective encoders / decoders so that the controller will get parameters similar to what they actually get in a real world situation
* set parameters as a query stringAaron Patterson2015-07-091-6/+9
| | | | | | We should convert request parameters to a query string, then let the request object parse that query string. This should give us results that are more similar to the real-world
* build and assign parameters rather than rely on mutationsAaron Patterson2015-07-081-1/+15
| | | | | We should assign parameters to the request object rather than mutate the hash that is returned by `query_parameters` or `request_parameters`
* assign the cookie hash on request allocationAaron Patterson2015-07-081-1/+1
| | | | this prevents mutations from being available globally
* request objects are no longer recycledAaron Patterson2015-07-081-10/+8
| | | | | | Instead of trying to manually clear out a request object, lets just allocate a new one. The rack ENV is reused and cleaned (still), but the request object is not.
* add a new constructor for allocating test requestsAaron Patterson2015-07-081-11/+13
|
* pass the starting env and session to build_requestAaron Patterson2015-07-081-3/+3
|
* pass the session and env in to the test requestAaron Patterson2015-07-081-4/+8
|
* allocate new responses rather than recycling themAaron Patterson2015-07-081-12/+5
| | | | | There is no reason to "recycle" response objects when we can just allocate a new one.
* pass cookies from the jar in the HTTP_COOKIE headereileencodes2015-07-071-8/+7
| | | | | we should be pushing the cookies in via headers rather than maintaining some object and "recycling" it.
* Send cookies with requesteileencodes2015-07-071-1/+4
|
* Update RDoc for ActionController::TestCase for kwargs.Victor Costan2015-06-121-1/+1
|
* Merge pull request #20138 from tgxworld/deprecated_assert_templateRafael Mendonça França2015-06-011-6/+0
|\ | | | | Deprecate `assert_template` and `assigns()`.
| * Remove `assigns` and `assert_template`.Guo Xiang Tan2015-05-301-6/+0
| |
* | Use `any?` rather than `present?` to check argseileencodes2015-05-311-1/+1
|/ | | | | | It's better to use Ruby methods when possible over methods defined by Active Support because then it does not need to rely on any dependencies.
* Remove unused code.Guo Xiang Tan2015-05-291-2/+0
| | | | Code was moved into the `assign` method.
* Merge pull request #19808 from byroot/action-parameterRafael Mendonça França2015-05-271-15/+12
|\ | | | | [PoC] Stop shadowing parameters named `action`
| * Allow to parameters named `action` or `controller` from AC::TestCase helpersJean Boussier2015-04-181-15/+12
| |
* | Move `TemplateAssertions` to their own fileeileencodes2015-05-091-188/+1
| | | | | | | | | | | | | | | | | | | | | | This moves `TemplateAssertions` out of the `test_case.rb` file and into it's own `template_assertions` file. It still inherits from `ActionController`.` This is in preparation for combining the code for Integration tests and Controller tests. This will need to be it's own file to be added to the `requires` for Integration tests. This does not currently change ANY behavior, just moving it for access later on.
* | Use `args` instead of `*args` in `kwargs_request?` methodeileencodes2015-05-021-3/+3
|/ | | | | | `*args` is not required here and should be avoided when not necessary because `*args` are slower than `args` and create unnecessary array allocations.
* Revert "Merge pull request #19682 from ↵Santiago Pastorino2015-04-121-5/+2
| | | | | | | supercaracal/fix_force_ssl_redirection_flash_error" This reverts commit d215620340be7cb29e2aa87aab22da5ec9e6e6a7, reversing changes made to bbbbfe1ac02162ecb5e9a7b560134a3221f129f3.
* fix fails to force_ssl_redirection if session_store is disabledTaishi Kasuga2015-04-091-2/+5
|
* Use request.session.id instead of request.session_options[:id]Brian John2015-03-121-1/+1
| | | | | | | | | As of the upgrade to Rack 1.5, request.session_options[:id] is no longer populated. Reflect this change in the tests by using request.session.id instead. Related change in Rack: https://github.com/rack/rack/commit/83a270d6
* Merge pull request #18771 from kirs/deprecate-xhrRafael Mendonça França2015-02-051-3/+18
|\ | | | | Migrating xhr methods to keyword arguments syntax
| * Migrating xhr methods to keyword arguments syntaxKir Shatrov2015-02-011-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | in `ActionController::TestCase` and `ActionDispatch::Integration` Old syntax: `xhr :get, :create, params: { id: 1 }` New syntax example: `get :create, params: { id: 1 }, xhr: true`
* | Merge pull request #18721 from sj26/pre-discard-flashAaron Patterson2015-02-011-0/+2
|\ \ | | | | | | Pre-discard flash messages
| * | Fix flash remaining after last flash deletedSamuel Cochran2015-01-291-0/+2
| | | | | | | | | | | | | | | | | | | | | Inside a controller functional test after the last flash is deleted it still persists the flash because to_session_value is nil. We should delete it from the session when the serialized version is nil, same as the flash middleware.
* | | Fix a typo in deprecation warning. #process takes method instead of http_method.Juanito Fatas2015-01-311-1/+1
| | |
* | | [ci skip] Document format parameter of process method in AC test_case.Juanito Fatas2015-01-311-0/+1
| |/ |/|
* | Use fixed fonts only in the name of the parameterRafael Mendonça França2015-01-291-8/+8
| |
* | Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-291-28/+93
|/ | | | | | | | 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
* Reset template assertions without warningsbrainopia2015-01-051-2/+4
|
* Remove deprecated option `use_route` in controller testsRafael Mendonça França2015-01-041-23/+1
|
* Integration requests should work in contexts without setup and teardownbrainopia2015-01-021-1/+2
|
* adding that assert_template with :layout will raise ArgumentError for ↵Carsten Wirth2014-12-161-0/+2
| | | | unknown layout type
* Deprecate `use_route` in controller testsGodfrey Chan2014-11-231-1/+22
| | | | Reference #17453
* Make sure assert_select can assert body tagRafael Mendonça França2014-11-181-4/+4
| | | | | | | | | This reverts commit f93df52845766216f0fe36a4586f8abad505cac4, reversing changes made to a455e3f4e9dbfb9630d47878e1239bc424fb7d13. Conflicts: actionpack/lib/action_controller/test_case.rb actionview/lib/action_view/test_case.rb
* document_root_element need to be publicRafael Mendonça França2014-11-171-4/+4
|
* Pass the route name explicitlyGodfrey Chan2014-11-101-1/+2
| | | | | | Follow up to 212057b9. Since that commit, we need to pass the `route_name` explicitly. This is one of the left-over cases that was not handled in that commit, which was causing `use_route` to be ignored in functional tests.
* Parse HTML as document fragment.Kasper Timm Hansen2014-09-291-1/+1
| | | | This is to match the changes in Rails Dom Testing rails/rails-dom-testing#20.
* Merge branch 'master' into loofahRafael Mendonça França2014-08-171-0/+9
|\ | | | | | | | | Conflicts: actionpack/CHANGELOG.md
| * Fix assert_template for files.Guo Xiang Tan2014-08-141-0/+9
| | | | | | | | | | The test was not failing for `assert_template file: nil` when a file has been rendered.
* | Merge branch 'master' into loofahRafael Mendonça França2014-08-121-43/+14
|\| | | | | | | | | | | | | Conflicts: actionpack/CHANGELOG.md actionpack/test/controller/integration_test.rb actionview/CHANGELOG.md
| * Remove ActionController::RaiseActionExceptions.Guo Xiang Tan2014-08-071-34/+0
| | | | | | | | | | The latest modification to the code was done in https://github.com/rails/rails/commit/5e3517ea. In Rails 3.2, `ActionController#rescue_action` was deprecated and `rescue_action_without_handler` is no longer being used.
| * avoid testing only_pathAaron Patterson2014-08-041-2/+1
| | | | | | | | | | we know that this call only wants the path returned, so lets call a method that returns the path.
| * Bug fix for assert_template when opening a new session.Guo Xiang Tan2014-07-251-5/+9
| | | | | | | | See https://github.com/rails/rails/pull/16234#commitcomment-7115670.
| * Fix AC::TemplateAssertions instance variables not resetting.Guo Xiang Tan2014-07-211-5/+7
| | | | | | | | Fixes https://github.com/rails/rails/issues/16119.
* | We don't need loofah for the assertionsRafael Mendonça França2014-07-151-1/+0
| | | | | | | | We can just use nokogiri