aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/response_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Push `before_sending` to super classeileencodes2015-12-061-0/+5
| | | | | | | | | | | | 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 skipped JRuby tests that are passing on 9.0.3.0.Guo Xiang Tan2015-10-271-2/+0
|
* Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compatJeremy Daer2015-10-061-5/+5
| | | | | | | | | | | | | | | | | Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries that support multiple Rails versions would've had to feature-detect whether to use `Mime::Type[:FOO]` or `Mime::FOO`. `Mime[:foo]` has been around for ages to look up registered MIME types by symbol / extension, though, so libraries and plugins can safely switch to that without breaking backward- or forward-compatibility. Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup by type or extension, so it's not available as `Mime[:all]`. We use it internally as a wildcard for `respond_to` negotiation. If you use this internal constant, continue to reference it with `Mime::ALL`. Ref. efc6dd550ee49e7e443f9d72785caa0f240def53
* Merge pull request #21848 from yui-knk/test_suppress_warningsSean Griffin2015-10-041-3/+2
|\ | | | | Suppress warnings of `assigned but unused variable`
| * Suppress warnings of `assigned but unused variable`yui-knk2015-10-031-3/+2
| |
* | Introduce `Headers#add`. Move `Response#add_header` upstream.Jeremy Daer2015-10-031-10/+10
|/ | | | | | | * Introduce `ActionDispatch::Http::Headers#add` to add a value to a multivalued header. * Move `Response#add_header` upstream: https://github.com/rack/rack/pull/957 * Match upstream `Response#have_header?` -> `#has_header?` name change.
* Response#add_header for adding to multi-valued headers like VaryJeremy Daer2015-10-011-0/+59
|
* adding test for content type with default charsetGaurav Sharma2015-10-021-1/+11
| | | | | * first test is for `default_charset` i.e `ActionDispatch::Response.default_charset = “utf-8”` * In below test we are passing `ActionDispatch::Response.default_charset = 'utf-16’` so name of the test is irrelevant — “read content type without charset”
* stop applying default headers in ActionDispatch::ResponseAaron Patterson2015-09-231-3/+3
| | | | | | | | | | I'm making this change so that I can construct response objects that *don't* have the default headers applied. For example, I would like to construct a response object from the return value of a controller. If you need to construct a response object with the default headers, then please use the alternate constructor: `ActionDispatch::Response.create`
* split cookie testsAaron Patterson2015-09-231-1/+6
| | | | these should really be multiple tests.
* don't mutate a response object after to_aAaron Patterson2015-09-231-0/+2
| | | | | | When the response object is `to_a`'d, that means it's been written to the socket. It doesn't make sense to mutate the response object after it's been written (and this may raise an exception in the future).
* stop calling deprecated methodsAaron Patterson2015-09-211-5/+5
| | | | | We should be asking the mime type method for the mime objects rather than via const lookup
* ensure that mutating headers will impact the content_type methodAaron Patterson2015-09-081-0/+5
|
* ensure that content type defaults to text / html when setting charsetAaron Patterson2015-09-081-0/+7
|
* Merge pull request #20590 from vngrs/set_default_charsetRafael Mendonça França2015-07-271-0/+7
|\ | | | | Document, refactor and create test case for ActionDispatch::Response
| * Document, refactor and create test case for ↵Mehmet Emin İNAÇ2015-06-171-0/+7
| | | | | | | | ActionDispatch::Response#charset= method
* | Skip a few failing tests on JRuby with the attached ticketsRobin Dupret2015-07-171-0/+2
|/
* remove `header=` on the response object.Aaron Patterson2015-06-151-0/+2
| | | | | | People should be free to mutate the header object, but not to set a new header object. That header object may be specific to the webserver, and we need to hide it's internals.
* Revert "Revert integration test refactoring that caused app test regressions"eileencodes2015-03-091-4/+0
| | | | This reverts commit 714205988315d2f98aa3e749747c44470e18676b.
* Work around for upstream Ruby bug #10685Genadi Samokovarov2015-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | In f6e293ec54f02f83cdb37502bea117f66f87bcae we avoided a segfault in the tests, however I think we should try to avoid the crash, as it may happen in user code as well. Here is what I distiled the bug down to: ```ruby # Rails case - works on 2.0, 2.1; crashes on 2.2 require 'action_dispatch' ActionDispatch::Response.new(200, "Content-Type" => "text/xml") # General case - works on 2.0, 2.1; crashes on 2.2 def foo(optional = {}, default_argument: nil) end foo('quux' => 'bar') ```
* Fix segmentation fault in ActionPack testseileencodes2015-02-281-1/+1
| | | | | | Introduced in f6e293e ActionPack tests began sefaulting. I found that it was the kwargs and the test causing the seg fault was missing the new default_headers argument.
* Revert integration test refactoring that caused app test regressionsJeremy Kemper2015-02-261-0/+4
| | | | | | | | | | | | Haven't diagnosed yet. No similarly failing tests in Rails to work from. cc @tenderlove, @eileencodes Revert "there is always an integration session, so remove the check" Revert "lazily create the integration session" Revert "use before_setup to set up test instance variables" This reverts commits 4cf3b8ac47f109fa83a6f66eb97d6cb0eace0d05, 303567e554de26822f3107be55c471d6477a745f, and fa63448420d3385dbd043aca22dba973b45b8bb2.
* lazily create the integration sessionAaron Patterson2015-02-121-4/+0
| | | | now we don't have to call reset! everywhere
* Remove deprecated `ActionDispatch::Response#to_ary`Rafael Mendonça França2015-01-041-16/+2
|
* Add support for Rack::ContentLength middelwareJavan Makhmali2014-09-061-0/+14
|
* Deprecate implicit AD::Response splatting and Array conversionJeremy Kemper2014-09-061-3/+17
|
* Restore Response.default_headers after test.Zuhao Wan2014-06-051-2/+4
|
* Do note remove `Content-Type` when `render :body`Prem Sichanugrist2014-03-051-8/+0
| | | | | | | | | | | | | `render :body` should just not set the `Content-Type` header. By removing the header, it breaks the compatibility with other parts. After this commit, `render :body` will returns `text/html` content type, sets by default from `ActionDispatch::Response`, and it will preserve the overridden content type if you override it. Fixes #14197, #14238 This partially reverts commit 3047376870d4a7adc7ff15c3cb4852e073c8f1da.
* Add `#no_content_type` attribute to `AD::Response`Prem Sichanugrist2014-02-181-1/+1
| | | | | Setting this attribute to `true` will remove the content type header from the request. This is use in `render :body` feature.
* Introduce `render :body` for render raw contentPrem Sichanugrist2014-02-181-0/+8
| | | | | | | | | | | | This is an option for sending a raw content back to browser. Note that this rendering option will unset the default content type and does not include "Content-Type" header back in the response. You should only use this option if you are expecting the "Content-Type" header to not be set. More information on "Content-Type" header can be found on RFC 2616, section 7.2.1. Please see #12374 for more detail.
* Prevent [response].flatten from recursing infinitely.Dan Kang2014-02-081-0/+9
| | | | | | Returning `self` from within the array returned by `to_ary` caused this. Instead, we can just substitute another object. It provides the `each` behavior required by the rack spec.
* Add missing test for response destructuring.Myron Marston2014-02-081-0/+9
|
* update Rails::Railtie::Configuration and ↵Jon Kessler2013-08-161-0/+5
| | | | ActionDispatch::Response#respond_to? to accept include_private argument
* Don't set X-UA-Compatible header by defaultGuillermo Iguaran2013-06-131-3/+1
| | | | | | We are setting this header to chrome=1 for Chrome Frame and this will be retired soon. Check http://blog.chromium.org/2013/06/retiring-chrome-frame.html for details
* Add 'X-UA-Compatible' => 'chrome=1' to default headersGuillermo Iguaran2013-01-291-1/+3
|
* Use Encoding::UTF_8 constant :do_not_litter:Akira Matsuda2013-01-281-1/+1
|
* Integrate Action Pack with Rack 1.5Carlos Antonio da Silva2013-01-251-1/+1
| | | | | | All ActionPack and Railties tests are passing. Closes #8891. [Carlos Antonio da Silva + Santiago Pastorino]
* set default_headers to nil after use it to avoid order dependent testsFrancesco Rodriguez2012-09-081-25/+32
|
* Added X-Content-Type-Options to the header defaults.Jim Jones2012-08-181-1/+3
| | | | With a value of "nosniff", this prevents Internet Explorer from MIME-sniffing a response away from the declared content-type.
* some testsEgor Homakov2012-08-091-0/+27
|
* adding a buffered stream to the response objectAaron Patterson2012-07-291-0/+20
|
* fix failure test 'test_can_wait_until_commit(ResponseTest)' in actionpackVladimir Strakhov2012-07-281-2/+2
|
* threads can wait on responses to be committedAaron Patterson2012-07-271-0/+9
|
* deprecate String#encoding_aware? and remove its usageSergey Nartimov2011-12-241-3/+0
|
* use Array#join so that file encoding doesn't impact returned string.Aaron Patterson2011-12-121-0/+9
| | | | Fixes #3957
* Use default charset when we read content type without charset.kennyj2011-12-071-0/+11
|
* Do not inherit from Rack::Response, remove a shit-ton of unused code.José Valim2011-04-191-16/+0
|
* cleaning up some warnings on 1.9.3Aaron Patterson2011-02-071-5/+5
|
* Fix status initialization when custom status providedKrekoten' Marjan2010-10-181-0/+4
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Move ETag and ConditionalGet logic from AD::Response to the middleware stack.José Valim2010-10-031-8/+3
|