aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | Remove arity check for `RouteSet#draw`yui-knk2015-11-211-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was added for migration from Rails 3.1 to upper, now we are developing Rails 5.
* | | | | | Fix typo [ci skip]Jake Worth2015-11-121-1/+1
| |_|/ / / |/| | | |
* | | | | Require only necessary concurrent-ruby classes.Jerry D'Antonio2015-11-042-2/+2
| | | | |
* | | | | tests, test should not care wether 9ms or 11ms have passed.Yves Senn2015-11-041-1/+1
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This solves: ``` Expected /Completed 200 OK in [\d]ms/ to match "Completed 200 OK in 943ms". ```
* | | | Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-035-11/+31
| | | |
* | | | Merge pull request #21251 from rodzyn/more_param_parser_testsSean Griffin2015-10-301-0/+14
|\ \ \ \ | |_|/ / |/| | | Add test for parsing application/vnd.api+json
| * | | Add test for parsing application/vnd.api+jsonMarcin Olichwirowicz2015-08-211-0/+14
| | | |
* | | | Revert "ActionController::Base#process() now only takes an action name"Aaron Patterson2015-10-291-0/+20
| | | | | | | | | | | | | | | | This reverts commit 9f93a5efbba3e1cbf0bfa700a17ec8d1ef60d7c6.
* | | | ActionController::Base#process() now only takes an action nameAaron Patterson2015-10-291-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | rather than an action name and *args. The *args were not being used in regular applications outside tests. This causes a backwards compatibility issue, but reduces array allocations for most users.
* | | | switch to JSON.dump to avoid infinite recursionAaron Patterson2015-10-291-1/+1
| | | |
* | | | Write the cookie jar it was not committed in TestCaseRafael Mendonça França2015-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 skipped JRuby tests that are passing on 9.0.3.0.Guo Xiang Tan2015-10-273-6/+0
| | | |
* | | | Tweaked wording used in some tests.Sebastian McKenzie2015-10-251-2/+2
| | | |
* | | | 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-231-6/+10
| | | |
* | | | FIX: Randomly failing test when running without GIL.Guo Xiang Tan2015-10-231-0/+6
| | | |
* | | | 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.
* | | | Merge pull request #20715 from simsalabim/feature/parse-rss-atom-as-xmlSean Griffin2015-10-201-13/+17
| | | | | | | | | | | | | | | | parse RSS/ATOM responses as XML, not HTML
* | | | Merge pull request #22003 from yui-knk/remove_needless_require_asYves Senn2015-10-201-1/+0
|\ \ \ \ | | | | | | | | | | Delete needless `require 'active_support/deprecation'`
| * | | | Delete needless `require 'active_support/deprecation'`yui-knk2015-10-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | When `require 'active_support/rails'`, 'active_support/deprecation' is automatically loaded.
* | | | | Show helpful messages on invalid param. encodingsAgis Anastasopoulos2015-10-191-0/+14
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-131-8/+27
|\ \ \ \ | | | | | | | | | | | | | | | Add basic support for access control headers to ActionDispatch::Static
| * | | | Add the ability of returning arbitrary headers to ActionDispatch::StaticYuki Nishijima2015-06-131-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-2/+13
|\ \ \ \ \ | | | | | | | | | | | | Change `Journey::Route#verb` to return string instead of regexp.
| * | | | | Change `Journey::Route#verb` to return string instead of regexp.yui-knk2015-10-032-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compatJeremy Daer2015-10-0612-128/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | move file sending to the response objectAaron Patterson2015-10-052-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| |/ / / / /
* / / / / / Introduce `Headers#add`. Move `Response#add_header` upstream.Jeremy Daer2015-10-032-10/+28
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| | | | |
* | | | | Don't set a nil Set-Cookie header when there aren't any cookies. Omit the ↵Jeremy Daer2015-10-011-74/+93
| | | | | | | | | | | | | | | | | | | | 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
* | | | | Added test case for deprecation of Mime.const_defined? and removed use of it.Ronak Jangir2015-09-271-1/+5
| | | | |
* | | | | fix Mime type in doc since mime types via constants is deprecated [ci skip]Gaurav Sharma2015-09-261-3/+3
| | | | |
* | | | | call `get` instead of controller.processAaron Patterson2015-09-231-12/+10
| | | | | | | | | | | | | | | | | | | | | | | | | we want the request to go through the test harness, not directly call the methods on the controller
* | | | | remove controller constructionAaron Patterson2015-09-231-8/+4
| | | | | | | | | | | | | | | | | | | | also remove req / res references
* | | | | stop directly referencing the request and response objectsAaron Patterson2015-09-231-23/+21
| | | | |
* | | | | test framework allocates the controller for usAaron Patterson2015-09-231-1/+0
| | | | |
* | | | | type of response should not matterAaron Patterson2015-09-231-6/+0
| | | | |
* | | | | don't touch the response object until after we call `get`Aaron Patterson2015-09-231-5/+2
| | | | |
* | | | | stop directly setting headers on the controllerAaron Patterson2015-09-231-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | again, since we are going through the test harness, all this is done for us.
* | | | | test against controller responsesAaron Patterson2015-09-231-52/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather than calling methods on the controller. We should test the values returned by the controller rather than assuming that the internals are implemented in a certain way.
* | | | | 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`
* | | | | don't access the response object before a request was madeAaron Patterson2015-09-231-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't make sense to access the response object before a request is made (how was a response object created without making a request?) This commit splits testing default headers and default header mutation tests and removes access to the pre-request response object.
* | | | | 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).