aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
Commit message (Collapse)AuthorAgeFilesLines
* Fix rendering a differently-formatted partial after cachingGeorge Claghorn2018-04-131-0/+8
|
* Add `TestCaseTest#test_request_format_kwarg_doesnt_mutate_params` to masterbogdanvlviv2018-04-101-0/+8
| | | | | | | | | Initially, the test was added to 5-0-stable in #32492 and a bit modified in #32506. This test ensures that request(in tests) doesn't mutate params. It was fixed since v5.1.0.beta1 by 98b8309569a326910a723f521911e54994b112fb and then on 5-0-stable by #32492. This commit adds this test to master branch in order to prevent any regressions.
* Merge pull request #32441 from composerinteralia/refute-notRafael França2018-04-042-7/+7
|\ | | | | Add custom RuboCop for `assert_not` over `refute`
| * Autocorrect `refute` RuboCop violationsDaniel Colson2018-04-032-7/+7
| | | | | | | | | | | | 73e7aab behaved as expected on codeship, failing the build with exactly these RuboCop violations. Hopefully `rubocop -a` will have been enough to get a passing build!
* | Merge pull request #32336 from vincedevendra/allow_mutating_dig_return_valueAaron Patterson2018-04-021-0/+8
|\ \ | |/ |/| Make mutating params#dig return value mutate underlying params
| * Make mutating params#dig mutate underlying paramsVince DeVendra2018-03-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | When #dig was called on a params object and return either a Hash or an Array, and that value was subsquently mutated, it would not modify the containing params object. That means that the behavior of `params.dig(:a, :b)[:c] = 1` did not match either `params[:a][:b][:c] = 1` nor `hash.dig(:a, :b)[:c] = 1`. Similarly to `ActionController::Parameters#[]`, use `#convert_hashes_to_parameters` to pre-convert values and insert them in the receiving params object prior to returning them.
* | Deprecate controller level force_sslDerek Prior2018-03-302-15/+29
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today there are two common ways for Rails developers to force their applications to communicate over HTTPS: * `config.force_ssl` is a setting in environment configurations that enables the `ActionDispatch::SSL` middleware. With this middleware enabled, all HTTP communication to your application will be redirected to HTTPS. The middleware also takes care of other best practices by setting HSTS headers, upgrading all cookies to secure only, etc. * The `force_ssl` controller method redirects HTTP requests to certain controllers to HTTPS. As a consultant, I've seen many applications with misconfigured HTTPS setups due to developers adding `force_ssl` to `ApplicationController` and not enabling `config.force_ssl`. With this configuration, many application requests can be served over HTTP such as assets, requests that hit mounted engines, etc. In addition, because cookies are not upgraded to secure only in this configuration and HSTS headers are not set, it's possible for cookies that are meant to be secure to be sent over HTTP. The confusion between these two methods of forcing HTTPS is compounded by the fact that they share an identical name. This makes finding documentation on the "right" method confusing. HTTPS throughout is quickly becomming table stakes for all web sites. Sites are expected to operate over HTTPS for all communication, sensitive or otherwise. Let's encourage use of the broader-reaching `ActionDispatch::SSL` middleware and elminate this source of user confusion. If, for some reason, applications need to expose certain endpoints over HTTP they can do so by properly configuring `config.ssl_options`.
* Ruby 2.4: take advantage of String#unpack1Jeremy Daer2018-03-011-1/+1
| | | | | https://bugs.ruby-lang.org/issues/12752 https://ruby-doc.org/core-2.4.0/String.html#method-i-unpack1
* We should call methods with `.method_name` not `::method_name`.utilum2018-02-222-5/+6
| | | | | | Found several instances. Follow up on 63d530c5e68a8cf53603744789f53ccbc7ac1a0e
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-172-2/+0
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Rails 6 requires Ruby 2.3+Jeremy Daer2018-02-171-16/+9
|
* Remove usage of strip_heredoc in the framework in favor of <<~Rafael Mendonça França2018-02-161-3/+2
| | | | | Some places we can't remove because Ruby still don't have a method equivalent to strip_heredoc to be called in an already existent string.
* Use assert_empty and assert_not_emptyDaniel Colson2018-01-256-11/+11
|
* Use assert_predicate and assert_not_predicateDaniel Colson2018-01-2519-116/+116
|
* Change refute to assert_notDaniel Colson2018-01-253-12/+12
|
* Use respond_to test helpersDaniel Colson2018-01-254-5/+5
|
* Suppress `warning: BigDecimal.new is deprecated`Yasuo Honda2017-12-151-1/+1
| | | | | | | | | | | | | | | | | | | | `BigDecimal.new` has been deprecated in BigDecimal 1.3.3 which will be a default for Ruby 2.5. Refer https://github.com/ruby/bigdecimal/commit/533737338db915b00dc7168c3602e4b462b23503 * This commit has been made as follows: ``` cd rails git grep -l BigDecimal.new | grep -v guides/source/5_0_release_notes.md | grep -v activesupport/test/xml_mini_test.rb | xargs sed -i -e "s/BigDecimal.new/BigDecimal/g" ``` - `activesupport/test/xml_mini_test.rb` Editmanually to remove `.new` and `::` - guides/source/5_0_release_notes.md This is a Rails 5.0 release notes.
* Merge pull request #31289 from witlessbird/fips-compatibilityEileen M. Uchitelle2017-12-142-2/+2
|\ | | | | Initial support for running Rails on FIPS-certified systems
| * Introduced `ActiveSupport::Digest` that allows to specify hash function ↵Dmitri Dolguikh2017-12-122-2/+2
| | | | | | | | | | | | | | | | implementation and defaults to `Digest::MD5`. Replaced calls to `::Digest::MD5.hexdigest` with calls to `ActiveSupport::Digest.hexdigest`.
* | Enable `Layout/LeadingCommentSpace` to not allow cosmetic changes in the futureRyuta Kamizono2017-12-142-2/+1
| | | | | | | | Follow up of #31432.
* | Enable `Layout/SpaceBeforeComma` rubocop rule, and fixed moreRyuta Kamizono2017-12-122-3/+3
| | | | | | | | Follow up of #31390.
* | Add secure `X-Download-Options` and `X-Permitted-Cross-Domain-Policies` to ↵Guillermo Iguaran2017-12-091-1/+1
| | | | | | | | default headers set.
* | Merge pull request #30780 from ↵Sean Griffin2017-12-071-0/+13
|\ \ | | | | | | | | | | | | JackMc/fix-chrome-referrer-invalidauthenticitytoken Fix issue #30658 by checking explicitly for 'null' referrer
| * | Add a better error message when a "null" Origin header occursJack McCracken2017-11-031-0/+13
| | |
* | | Correct routing test spelling mistake.Philip Tolton2017-12-061-1/+1
| | |
* | | Yield array from AC::Parameters#each for block with one argDominic Cleal2017-12-061-0/+16
| |/ |/| | | | | Matches Hash#each behaviour as used in Rails 4.
* | Update send_file headers test to use mp4 as example instead of mpgGuillermo Iguaran2017-11-281-1/+1
| |
* | Merge pull request #31099 from nobu/patch-1Rafael Mendonça França2017-11-091-1/+1
|\ \ | |/ |/| | | Use `Tempfile.create`
| * Use `Dir.mktmpdir`Nobuyoshi Nakada2017-11-091-1/+1
| | | | | | | | As `@cache_path` is expected to be a directory name, use `Dir.mktmpdir`. And omit unnecessary `Dir.tmpdir`.
| * Use `Tempfile.create`Nobuyoshi Nakada2017-11-091-1/+1
|/ | | Instead of `Dir::Tmpname.make_tmpname`, an internal method which does not guarantee uniqueness, use `Tempfile.create`.
* Merge pull request #31004 from shuheiktgw/remove_unnecessary_returnsRafael França2017-10-311-1/+1
|\ | | | | Remove redundant return statements
| * removed unnecessary returnsShuhei Kitagawa2017-10-281-1/+1
| |
* | Merge pull request #31005 from shuheiktgw/remove_unnecessary_semicolonsMatthew Draper2017-10-283-8/+8
|\ \ | |/ |/| | | Removed unnecessary semicolons
| * removed unnecessary semicolonsShuhei Kitagawa2017-10-282-7/+7
|/
* checking for nested attributes when attribute names specified to wrap them ↵Kelton Manzanares2017-10-251-0/+14
| | | | as well
* Add allow_other_host option to redirect_back methodTim Masliuchenko2017-10-101-0/+21
|
* Remove `:api:` tag that has leaked on the doc directly [ci skip]Ryuta Kamizono2017-09-301-3/+0
| | | | | | | | | | | | Currently `:api:` tag has leaked on the doc directly since RDoc doesn't support `:api:` tag directive. http://api.rubyonrails.org/v5.1/classes/AbstractController/Rendering.html So `:api: private` doesn't work as expected. We are using `:nodoc:` for the purpose. Related #13989.
* Add key rotation cookies middlewareMichael Coyne2017-09-242-2/+6
| | | | | | Using the action_dispatch.cookies_rotations interface, key rotation is now possible with cookies. Thus the secret_key_base as well as salts, ciphers, and digests, can be rotated without expiring sessions.
* fix type fully qualified [ci skip]Yauheni Dakuka2017-09-061-1/+1
|
* Merge pull request #30367 from ptoomey3/consistent-cache-control-headersAaron Patterson2017-09-051-0/+21
|\ | | | | Normalize/process Cache-Control headers consistently
| * Use equality in place of refute assertions for accuracyPatrick Toomey2017-08-221-4/+2
| |
| * Normalize/process Cach-Control headers consistentlyPatrick Toomey2017-08-221-0/+23
| | | | | | | | | | | | | | | | | | | | In the existing logic, the `Cache-Control` header may or may not get normalized by additional logic depending on whether `response.cache_conrol` has been modified. This leads to inconsistent behavior, since sometimes `Cache-Control` can contain whatever a user sets and sometimes it gets normalized, based on the logic inside of `set_conditional_cache_control!`. It seems like this normalization process should happen regardless to ensure consistent behavior.
* | Fix `can't modify frozen String` error in AC::RenderingKoichi ITO2017-09-021-0/+12
|/
* Fix RuboCop offensesKoichi ITO2017-08-164-17/+17
| | | | And enable `context_dependent` of Style/BracesAroundHashParameters cop.
* Path parameters should default to UTF8eileencodes2017-08-011-0/+16
| | | | | | | | | | | | | | | | | | | | This commit changes the behavior such the path_params now default to UTF8 just like regular parameters. This also changes the behavior such that if a path parameter contains invalid UTF8 it returns a 400 bad request. Previously the behavior was to encode the path params as binary but that's not the same as query params. So this commit makes path params behave the same as query params. It's important to test with a path that's encoded as binary because that's how paths are encoded from the socket. The test that was altered was changed to make the behavior for bad encoding the same as query params. We want to treat path params the same as query params. The params in the test are invalid UTF8 so they should return a bad request. Fixes #29669 *Eileen M. Uchitelle, Aaron Patterson, & Tsukuru Tanimichi*
* Use frozen string literal in actionpack/Kir Shatrov2017-07-2979-0/+158
|
* Make actionpack frozen string friendlyKir Shatrov2017-07-246-7/+19
|
* [Action Pack] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Add ActionController::Base.skip_forgery_protectionLisa Ugray2017-07-101-0/+30
| | | | | | Since we now default to `protect_from_forgery with: :exception`, provide a wrapper to `skip_before_action :verify_authenticity_token` for disabling forgery protection.
* Prepare AP and AR to be frozen string friendlyKir Shatrov2017-07-061-1/+2
|