aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_base/bare_metal_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Performance/UnfreezeString` copyuuji.yaginuma2018-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`. ```ruby # frozen_string_literal: true require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "benchmark-ips" end Benchmark.ips do |x| x.report('+@') { +"" } x.report('dup') { "".dup } x.compare! end ``` ``` $ ruby -v benchmark.rb ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] Warming up -------------------------------------- +@ 282.289k i/100ms dup 187.638k i/100ms Calculating ------------------------------------- +@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s Comparison: +@: 6775299.3 i/s dup: 3320400.7 i/s - 2.04x slower ```
* Make actionpack frozen string friendlyKir Shatrov2017-07-241-1/+3
|
* 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
|
* "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-251-1/+1
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-12/+12
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Handle response_body= when body is nileileencodes2016-01-301-0/+16
| | | | | | | | | There are some cases when the `body` in `response_body=` can be set to nil. One of those cases is in `actionpack-action_caching` which I found while upgrading it for Rails 5. It's not possible to run `body.each` on a `nil` body so we have to return after we run `response.reset_body!`.
* 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.
* remove RackDelegation moduleAaron Patterson2015-08-261-2/+0
| | | | | | Since all controller instances are required to have a request and response object, RackDelegation is no longer needed (we always have to delegate to the response)
* 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
* rack SPEC doesn't allow `first` on the bodyAaron Patterson2015-08-251-8/+12
| | | | collect the body and make assert against the collected body
* Add `ActionController::Metal#set_request!`brainopia2015-01-211-0/+9
| | | | | Add `ActionController::Metal#set_request!` to set a request on controller instance without calling dispatch.
* Prevent state leak.Guo Xiang Tan2014-06-051-0/+2
|
* The correct status to test should be :switching_protocols.Zuhao Wan2014-05-251-2/+2
|
* Collapsed dual checks (one for content headers and one for content) into a ↵Armand du Plessis2012-08-021-0/+30
| | | | | | | | | | | | single check. Rails includes a single character body to a head(:no_content) response to work around an old Safari bug where headers were ignored if no body sent. This patch brings the behavior slightly closer to spec if :no_content/204 is explicity requested via a head only response. Status comparison done on symbolic and numeric values Not returning any content when responding with head and limited to a status code that explicitly states no content will be returned - 100..199, 204, 205, 304.
* Remove content-length as welltwinturbo2012-05-031-0/+6
|
* Make ActionController#head pass rack-linktwinturbo2012-05-031-0/+60
|
* A test case to ensure that AC::Metal#response_body= always wraps the given ↵Akira Matsuda2011-11-101-0/+6
| | | | value in an Array in both Ruby 1.8 and 1.9 (refs #3581)
* cleaning up some warnings on 1.9.3Aaron Patterson2011-02-071-1/+1
|
* Fix problems trying to functional test AC::Metal controllersSantiago Pastorino2010-11-061-0/+7
| | | | [#5393 state:committed]
* Fix a few bugs when trying to use Head standalonewycats2010-10-101-0/+15
|
* Use better assertion methods for testingNeeraj Singh2010-05-191-2/+2
| | | | | | [#4645 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Return a valid Rack response from bare ActionController::MetalCarlhuda2010-03-181-0/+27