aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
Commit message (Collapse)AuthorAgeFilesLines
* Remove deprecated methods in ActionController::ParametersRafael Mendonça França2016-10-103-27/+5
|
* Remove deprecated comparing support with `ActionController::Parameters`Rafael Mendonça França2016-10-103-17/+5
|
* Remove deprecated support to :text in renderRafael Mendonça França2016-10-104-212/+5
|
* Remove deprecated support to :nothing in renderRafael Mendonça França2016-10-093-15/+4
|
* Remove deprecated support to `:back` in `redirect_to`Rafael Mendonça França2016-10-093-50/+4
|
* Remove deprecated support for status option in headRafael Mendonça França2016-10-093-28/+5
|
* Remove deprecation at ActionController::BadRequestRafael Mendonça França2016-10-092-11/+6
|
* Remove deprecated methods related to controller filtersRafael Mendonça França2016-10-094-116/+8
| | | | | | | | | | `skip_action_callback`, `skip_filter`, `before_filter`, `prepend_before_filter`, `skip_before_filter`, `append_before_filter`, `around_filter` `prepend_around_filter`, `skip_around_filter`, `append_around_filter`, `after_filter`, `prepend_after_filter`, `skip_after_filter` and `append_after_filter`.
* Silence a warningRafael Mendonça França2016-10-071-1/+3
|
* Undefine assings in IntegrationTestRafael Mendonça França2016-10-072-0/+10
| | | | | assigns assert the state of a controller instance what should not be done in an integration test.
* [ci-skip] Swap method and its alias, format docAndrey Molchanov2016-10-041-3/+4
|
* Show an "unmatched constraints" error for mismatching and present paramsChris Carter2016-10-035-9/+23
| | | | | | | | | | | | Currently a misleading "missing required keys" error is thrown when a param fails to match the constraints of a particular route. This commit ensures that these params are recognised as unmatching rather than missing. Note: this means that a different error message will be provided between optimized and non-optimized path helpers, due to the fact that the former does not check constraints when matching routes. Fixes #26470.
* Remove obsolete comment about class-level respond_toAndrew White2016-10-011-2/+0
| | | | | | The class-level respond_to was extracted in ee77770 to responders gem [ci skip]
* Merge pull request #26573 from kirs/action-controller-as-formatRafael França2016-09-272-4/+9
|\ | | | | Make :as option also set request format (AC::TestCase)
| * Make :as option also set request format (AC::TestCase)Kir Shatrov2016-09-212-4/+9
| | | | | | | | | | | | | | | | right now you'd have to specify both :as and :format: ``` post :create, params: { foo: "bar" } as: :json, format: :json ```
* | Merge pull request #26607 from matthewd/skip-fixture-pathMatthew Draper2016-09-242-1/+9
|\ \ | | | | | | Only search fixture_path for files that can't be found directly
| * | Only search fixture_path for files that can't be found directlyMatthew Draper2016-09-242-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When passed an already-valid file name, prepending the path is likely to create problems. This is particularly relevant for #26384, which adds fixture_path handling to test classes that previously didn't have it: any existing caller must have been manually locating the file, and we don't want to break them.
* | | Add #25546 and #25817 to changelog [ci skip]Philip Nguyen2016-09-231-0/+8
|/ /
* | Merge pull request #26589 from kirs/ad-test-request-methodArthur Nogueira Neves2016-09-222-1/+8
|\ \ | | | | | | Fix memoization bug on ActionDispatch::TestRequest#request_method=
| * | Fix memoization bug on ActionDispatch::TestRequest#request_method=Kir Shatrov2016-09-222-1/+8
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TestRequest have been overrriding request_method setter since 2009, but the actual implementation in Request (not TestRequest) has been changed since that. Now it's also using @request_method instance variable to keep the state. The override in TestRequest have not been calling `super`, which caused a bug that after accessing #requst_method the value was memoized and then we've never been able to change it anymore: ``` req = ActionDispatch::TestRequest.create puts "was: #{req.request_method}" # memoized here req.request_method = "POST" puts "became: #{req.request_method}" ``` output: ``` was: GET became: GET ``` Since the whole purpose of overriding the setter in TestRequest is to upcase it, I'm changing it to `super(method.to_s.upcase)`
* | improve error message when include assertions failMichael Grosser2016-09-167-21/+21
| | | | | | | | | | | | 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
* | Merge pull request #26498 from FriedSock/correct-render-text-deprecation-messageRafael França2016-09-141-1/+1
|\ \ | | | | | | Correct `render text:` deprecation message
| * | Correct `render text:` deprecation messageJack Bracewell2016-09-141-1/+1
| | | | | | | | | The default Content-Type is `text/html`, not `text/plain`.
* | | Merge pull request #26477 from kirs/action_dispatch-assert_responseRafael França2016-09-142-2/+29
|\ \ \ | |/ / |/| | Improve assert_response helper
| * | Improve assert_response helperKir Shatrov2016-09-142-2/+29
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the check is failed, print the actual response body if it's not too large. This could improve productivity when writing new tests. Before: ``` ThemeEditorIntegrationTest#test_whatever Expected response to be a <200: ok>, but was a <422: Unprocessable Entity>. Expected: 200 Actual: 422 ``` After: ``` ThemeEditorIntegrationTest#test_whatever Expected response to be a <200: ok>, but was a <422: Unprocessable Entity>. Expected: 200 Actual: 422 Response body: {"errors":["Invalid settings object for section '1'"]} ```
* | Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-1410-49/+49
| | | | | | | | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* | Do not mutate AC::TestRequest::DEFAULT_OPTIONSKir Shatrov2016-09-102-1/+6
|/
* Merge pull request #26418 from y-yagi/fixes_26415Richard Schneeman2016-09-072-1/+8
|\ | | | | call `.to_h` to avoid using deprecated method
| * call `.to_h` to avoid using deprecated methodyuuji.yaginuma2016-09-072-1/+8
| | | | | | | | | | | | | | | | | | | | | | `ActionController::Parameters#merge` call `HashWithIndifferentAccess#merge`. In addition, it calls `HashWithIndifferentAccess#update` from `HashWithIndifferentAccess#merge`, where it is called the `#to_hash` of argument. But `ActionController::Parameters#to_hash` is deprecated, warning message is displayed. To avoid this, modify to convert object to `Hash`. Fixes #26415
* | Merge pull request #26016 from nateberkopec/patch-1Vipul A M2016-09-071-2/+3
|\ \ | |/ |/| Clarify expires_now documentation
| * Clarify expires_now documentationNate Berkopec2016-09-061-2/+3
| | | | | | | | [ci skip]
* | Merge pull request #26377 from y-yagi/rename_test_method_to_avoid_overridingEileen M. Uchitelle2016-09-041-1/+1
|\ \ | | | | | | rename test method to avoid overriding
| * | rename test method to avoid overridingyuuji.yaginuma2016-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This removes the following warning. ``` ./test/dispatch/routing_test.rb:3696: warning: method redefined; discarding old test_namespaced_roots ./test/dispatch/routing_test.rb:1632: warning: previous definition of test_namespaced_roots was here ```
* | | Merge pull request #26384 from ↵Eileen M. Uchitelle2016-09-043-1/+43
|\ \ \ | | | | | | | | | | | | | | | | y-yagi/make_fixture_file_upload_in_integration_test make `fixture_file_upload` work in integration tests
| * | | make `fixture_file_upload` work in integration testsyuuji.yaginuma2016-09-043-1/+43
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Currently, `fixture_file_upload` does not work in integration test. Because, `TestProcess` module has been include in `Session` class, but `fixture_path` can not get from `Session` class. Modify to include `TestProcess` in `IntegrationTest` class in order to get correct value of `fixture_path`.
* / / Fix broken heredoc indentation caused by rubocop auto-correctRyuta Kamizono2016-09-033-8/+8
|/ / | | | | | | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But heredocs was still kept absolute position. This commit aligns heredocs indentation for consistency.
* | RuboCop is 100% green :tada:Xavier Noria2016-09-022-11/+12
| |
* | fixes remaining RuboCop issues [Vipul A M, Xavier Noria]Xavier Noria2016-09-0110-15/+15
| |
* | Start passing cipher from EncryptedCookieJar since we use it to determine ↵Vipul A M2016-09-012-20/+17
| | | | | | | | key length
* | Follow up of #25602Vipul A M2016-09-012-15/+31
| | | | | | | | | | | | | | | | | | Since keys are truncated, ruby 2.4 doesn't accept keys greater than their lenghts. keys of same value but different lenght and greater than key size of cipher, produce the same results as reproduced at https://gist.github.com/rhenium/b81355fe816dcfae459cc5eadfc4f6f9 Since our default cipher is 'aes-256-cbc', key length for which is 32 bytes, limit the length of key being passed to Encryptor to 32 bytes. This continues to support backwards compat with any existing signed data, already encrupted and signed with 32+ byte keys. Also fixes the passing of this value in multiple tests.
* | Add changelog entry for #26328.Kasper Timm Hansen2016-08-311-0/+7
| | | | | | | | | | I consider the missing deprecation warning a bug fix from the point of view of the 5.0.x series and forward.
* | Move to_param undef closer to the deprecations.Kasper Timm Hansen2016-08-311-2/+4
| | | | | | | | | | | | | | Makes it clearer why we're doing this Add a comment to elaborate on what the undef means and move it closer to the deprecations so it's less likely for whoever pulls the deprecations that it should go too.
* | Merge pull request #26328 from kirs/strong-params-to-paramKasper Timm Hansen2016-08-312-0/+9
|\ \ | | | | | | Do not allow to_param on AC::Parameters
| * | Do not allow to_param on AC::ParametersKir Shatrov2016-08-312-0/+9
| | |
* | | Override `respond_to_missing?` instead of `respond_to?` when possibleSean Griffin2016-08-312-2/+2
|/ / | | | | | | | | | | | | | | | | | | This was almost every case where we are overriding `respond_to?` in a way that mirrors a parallel implementation of `method_missing`. There is one remaining case in Active Model that should probably do the same thing, but had a sufficiently strange implementation that I want to investigate it separately. Fixes #26333.
* | Merge pull request #26317 from maclover7/jm-fix-26298Aaron Patterson2016-08-293-8/+30
|\ \ | | | | | | Allow `send_file` to declare a charset
| * | Remove default argument, and extract internal convenience methodJon Moss2016-08-291-6/+12
| | |
| * | Add regression testsJon Moss2016-08-291-0/+14
| | |
| * | Allow `send_file` to declare a charsetJon Moss2016-08-292-4/+6
| | | | | | | | | | | | | | | | | | Removed my patch in favor of @tenderlove's less invasive approach. [Aaron Patterson & Jon Moss]
* | | Fix nested multiple rootsRyo Hashimoto2016-08-293-2/+61
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PR #20940 enabled the use of multiple roots with different constraints at the top level but unfortunately didn't work when those roots were inside a namespace and also broke the use of root inside a namespace after a top level root was defined because the check for the existence of the named route used the global :root name and not the namespaced name. This is fixed by using the name_for_action method to expand the :root name to the full namespaced name. We can pass nil for the second argument as we're not dealing with resource definitions so don't need to handle the cases for edit and new routes. Fixes #26148.