aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | use `dispatch` instead of `process` to run requests thougheileencodes2015-10-292-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `dispatch` sets the request and response on the controller for us automatically, so the test harness doesn't need to know the internals of how request / response is set. Conflicts: actionpack/lib/action_controller/test_case.rb
* | | | | Remove unnecessary methodeileencodes2015-10-291-3/+0
| | | | |
* | | | | specify deprecated waring, follow the standard conventionsGaurav Sharma2015-10-282-6/+6
| | | | | | | | | | | | | | | | | | | | `skip_filter`, `skip_action_callback` may both are deprecated in Rails 5.1 so waring msg should be specific.
* | | | | Write the cookie jar it was not committed in TestCaseRafael Mendonça França2015-10-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For ActionController::Base we write the cookies in a middleware if it was not yet committed no matter if the response was committed or not. [1] For ActionController::Live we write the cookies before the response is committed. [2] We already mimic ActionController::Live in ActionController::TestCase but we don't mimic the ActionController::Base behavior because we were checking if the response was committed before writing the cookies. Now we are matching the behavior of the middleware and writing the cookies if it was not written before. [1]: https://github.com/rails/rails/blob/80c6b901d4d87cee610ab0a438ff6e3c6bf118d1/actionpack/lib/action_dispatch/middleware/cookies.rb#L599-L604 [2]: https://github.com/rails/rails/blob/80c6b901d4d87cee610ab0a438ff6e3c6bf118d1/actionpack/lib/action_controller/metal/live.rb#L218-L223
* | | | | Remove dead codeRafael Mendonça França2015-10-281-5/+0
| | | | | | | | | | | | | | | | | | | | This is leftover from when `render nothing: true` rendered blank string.
* | | | | Remove skipped JRuby tests that are passing on 9.0.3.0.Guo Xiang Tan2015-10-273-6/+0
| | | | |
* | | | | Merge pull request #22060 from sebmck/tweak-wordingClaudio B2015-10-251-2/+2
|\ \ \ \ \ | | | | | | | | | | | | Tweaked wording used in some tests.
| * | | | | Tweaked wording used in some tests.Sebastian McKenzie2015-10-251-2/+2
| | | | | |
* | | | | | fix rdoc markup [ci skip]yuuji.yaginuma2015-10-251-4/+4
|/ / / / /
* | | | | Remove skip on tests that have been fixed.Guo Xiang Tan2015-10-241-4/+0
| | | | |
* | | | | Catch invalid UTF-8 querystring values and respond with BadRequestGrey Baker2015-10-234-7/+37
| | | | |
* | | | | FIX: Randomly failing test when running without GIL.Guo Xiang Tan2015-10-231-0/+6
| | | | |
* | | | | Merge pull request #22029 from yui-knk/fixup_content_type_regexpRafael Mendonça França2015-10-221-1/+1
|\ \ \ \ \ | | | | | | | | | | | | Use sufficient a regexp anchor to check `@response.content_type.to_s`
| * | | | | Use sufficient a regexp anchor to check `@response.content_type.to_s`yui-knk2015-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit follows up of ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9. To check `@response.content_type.to_s` is ended with `"xml"`, to use `\z` is sufficient.
* | | | | | Merge pull request #19327 from rousisk/masterSean Griffin2015-10-221-2/+2
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Change Integer#year to return a Fixnum instead of a Float to improve consistency
| * | | | | Change Integer#year to return a Fixnum instead of a Float to improve consistencyKonstantinos Rousis2015-10-221-2/+2
| | | | | |
* | | | | | Suppress warnings (warnings about AD::IntegrationTest HTTP request)yui-knk2015-10-221-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | These warings have been appeared from ea9bc06c9a47b839d5e2db94ba6bf7e29c8f0ae9.
* | | | | remove unnecessary forwardable requireTimo Schilling2015-10-211-1/+0
| | | | | | | | | | | | | | | `Forwardable` has been used in the past
* | | | | Merge pull request #20715 from simsalabim/feature/parse-rss-atom-as-xmlSean Griffin2015-10-203-14/+22
| | | | | | | | | | | | | | | | | | | | parse RSS/ATOM responses as XML, not HTML
* | | | | Merge pull request #22003 from yui-knk/remove_needless_require_asYves Senn2015-10-206-7/+0
|\ \ \ \ \ | | | | | | | | | | | | Delete needless `require 'active_support/deprecation'`
| * | | | | Delete needless `require 'active_support/deprecation'`yui-knk2015-10-206-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When `require 'active_support/rails'`, 'active_support/deprecation' is automatically loaded.
* | | | | | Show helpful messages on invalid param. encodingsAgis Anastasopoulos2015-10-194-8/+27
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, given a route: # config/routes.rb get ':a' => "foo#bar" If one pointed to http://example.com/%BE (param `a` has invalid encoding), a `BadRequest` would be raised with the following non-informative message: ActionController::BadRequest From now on the message displayed is: Invalid parameter encoding: hi => "\xBE" Fixes #21923.
* | | | | Merge pull request #19135 from yuki24/access-control-supportJeremy Daer2015-10-133-16/+60
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | Add basic support for access control headers to ActionDispatch::Static
| * | | | | Add the ability of returning arbitrary headers to ActionDispatch::StaticYuki Nishijima2015-06-133-16/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now ActionDispatch::Static can accept HTTP headers so that developers will have control of returning arbitrary headers like 'Access-Control-Allow-Origin' when a response is delivered. They can be configured through `#config.public_file_server.headers`: config.public_file_server.headers = { "Cache-Control" => "public, max-age=60", "Access-Control-Allow-Origin" => "http://rubyonrails.org" } Also deprecate `config.static_cache_control` in favor of `config.public_file_server.headers`.
* | | | | | Merge pull request #21849 from yui-knk/refactor_regexp_to_stringAndrew White2015-10-124-7/+14
|\ \ \ \ \ \ | | | | | | | | | | | | | | Change `Journey::Route#verb` to return string instead of regexp.
| * | | | | | Change `Journey::Route#verb` to return string instead of regexp.yui-knk2015-10-034-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By [this commit](https://github.com/rails/rails/commit/0b476de445faf330c58255e2ec3eea0f3a7c1bfc) `Journey::Route#verb` need not to return verb as regexp. The returned value is used by inspector, so change it to be a string. Add inspect_with_multiple_verbs test case to keep the behavior of inspector correctly.
* | | | | | | Allow multiple `root` routes in same scope levelRafael Sales2015-10-102-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an application has multiple root entries with different constraints, the current solution is to use `get '/'`. Example: **Currently I have to do:** ```ruby get '/', to: 'portfolio#show', constraints: ->(req) { Hostname.portfolio_site?(req.host) } get '/', to: 'blog#show', constraints: ->(req) { Hostname.blog_site?(req.host) } root 'landing#show' ``` **But I would like to do:** ```ruby root 'portfolio#show', constraints: ->(req) { Hostname.portfolio_site?(req.host) } root 'blog#show', constraints: ->(req) { Hostname.blog_site?(req.host) } root 'landing#show' ``` Other URL matchers such as `get`, `post`, etc, already allows this, so I think it's fair that `root` also allow it since it's just a shortcut for a `get` internally.
* | | | | | | used predicate methods to avoid is_a? checksRonak Jangir2015-10-102-3/+5
| | | | | | |
* | | | | | | Fix mounted engine named routes regressionMatthew Erhard2015-10-073-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating the url for a mounted engine through its proxy, the path should be the sum of three parts: 1. Any `SCRIPT_NAME` request header or the value of `ActionDispatch::Routing::RouteSet#relative_url_root`. 2. A prefix (the engine's mounted path). 3. The path of the named route inside the engine. Since commit https://github.com/rails/rails/commit/44ff0313c121f528a68b3bd21d6c7a96f313e3d3, this has been broken. Step 2 has been changed to: 2. A prefix (the value of `ActionDispatch::Routing::RouteSet#relative_url_root` + the engine's mounted path). The value of `ActionDispatch::Routing::RouteSet#relative_url_root` is taken into account in step 1 of the route generation and should be ignored when generating the mounted engine's prefix in step 2. This commit fixes the regression by having `ActionDispatch::Routing::RouteSet#url_for` check `options[:relative_url_root]` before falling back to `ActionDispatch::Routing::RouteSet#relative_url_root`. The prefix generating code then sets `options[:relative_url_root]` to an empty string. This empty string is used instead of `ActionDispatch::Routing::RouteSet#relative_url_root` and avoids the duplicate `relative_url_root` value in the final result. This resolves #20920 and resolves #21459
* | | | | | | use methods for accessing the cache control headersAaron Patterson2015-10-062-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the methods rack provides so we don't have to worry about the exact header key.
* | | | | | | etag header is in Rack, so use it's response methodsAaron Patterson2015-10-061-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rack implements the Etag header manipulation methods, so we can use those instead of ours.
* | | | | | | Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compatJeremy Daer2015-10-0627-208/+187
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #21887 from abhishekjain16/doc_fixKasper Timm Hansen2015-10-061-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix usage of word alternatively in docs [ci skip]
| * | | | | | | Fix usage of word alternatively in docs [ci skip]Abhishek Jain2015-10-061-1/+1
| | | | | | | |
* | | | | | | | [ci skip] Change 'an URL' to 'a URL' as URL doesn't have a vowel soundtanmay30112015-10-062-2/+2
|/ / / / / / /
* | | | | | | move file sending to the response objectAaron Patterson2015-10-056-30/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Just a slight refactor that delegates file sending to the response object. This gives us the advantage that if a webserver (in the future) provides a response object that knows how to do accelerated file serving, it can implement this method.
* | | | | | | 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
| |/ / / / /
* | | | | | Merge branch 'master' of github.com:rails/docrailsVijay Dev2015-10-043-3/+5
|\ \ \ \ \ \
| * | | | | | Revert "proper raise ArgumentError, divided large text new line"Rafael Mendonça França2015-09-282-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4147ab730e807f622e5260a5f876749ff41fef26.
| * | | | | | proper raise ArgumentError, divided large text new lineGaurav Sharma2015-09-292-4/+4
| | | | | | |
| * | | | | | Renamed ‘Return’ to ‘Returns’ [ci skip]Ronak Jangir2015-09-282-3/+3
| | | | | | |
| * | | | | | [ci skip] Fix document of `ActionController::RequestForgeryProtection`yui-knk2015-09-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add `end` to end of class definition * add a blank line between explanation and example code
* | | | | | | Introduce `Headers#add`. Move `Response#add_header` upstream.Jeremy Daer2015-10-035-33/+36
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-012-0/+79
| | | | | |
* | | | | | Don't set a nil Set-Cookie header when there aren't any cookies. Omit the ↵Jeremy Daer2015-10-012-75/+96
| | | | | | | | | | | | | | | | | | | | | | | | header.
* | | | | | 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”
* | | | | | Remove TestRouter#add_routesakihiro172015-09-291-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, we use the mapper to build the routing table related to https://github.com/rails/rails/commit/703275ba70efbefb3358052b6ba750443eff1a28
* | | | | | remove useless methodAaron Patterson2015-09-281-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the caller of `handle_conditional_get!` checks the committed state of the response, so we don't need to in the subclass.
* | | | | | Added test case for deprecation of Mime.const_defined? and removed use of it.Ronak Jangir2015-09-271-1/+5
| | | | | |