aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
Commit message (Collapse)AuthorAgeFilesLines
* add a new constructor for allocating test requestsAaron Patterson2015-07-081-9/+9
|
* make `env` a required parameterAaron Patterson2015-07-081-6/+6
|
* pass cookies from the jar in the HTTP_COOKIE headereileencodes2015-07-071-2/+0
| | | | | we should be pushing the cookies in via headers rather than maintaining some object and "recycling" it.
* Merge pull request #13897 from gmalette/nested-parameter-filtering-2Arthur Nogueira Neves2015-07-061-0/+1
|\ | | | | Allow filtering params based on parent keys
| * Allow filtering params based on parent keysGuillaume Malette2015-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | Add the possibility to only filter parameters based on their full path instead of relying on the immediate key. config.filter_parameters += ['credit_card.code'] { 'credit_card' => { 'code' => '[FILTERED]' }, 'source' => { 'code' => '<%= puts 5 %>' } }
* | Improve error messages in cookies_testeileencodes2015-06-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using `assert_predicate` and `assert_match` instead of just `assert` is preferrable because better error messages are output. In the case of `assert response.cookies.empty?` the error message was `Failed assertion, no message given.` but now with `assert_predicate` it will be `Expected {"user_name"=>"david"} to be empty?.` For `assert_match(/user_name=david/, response.headers["Set-Cookie"])` as well, the message returned was unhelpful - `Failed assertion, no message given.` but now will tell what was expected and what was returned with `Expected /user_name=david/ to match "user_name=nope; path=/".`
* | Merge pull request #19431 from hmarr/head-routingRafael Mendonça França2015-06-221-3/+2
|\ \ | |/ |/| Respect routing precedence for HEAD requests
| * Respect routing precedence for HEAD requestsHarry Marr2015-03-201-3/+2
| | | | | | | | | | | | | | Fixes the issue described in #18764 - prevents Rack middleware from swallowing up HEAD requests that should have been matched by a higher-precedence `get` route, but still allows Rack middleware to respond to HEAD requests.
* | 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.
* | ActionDispatch::SSL should keep original header's behaviorFumiaki MATSUSHIMA2015-06-141-0/+11
| | | | | | | | | | | | `ActionDispatch::SSL` changes headers to `Hash`. So some headers will be broken if there are some middlewares on ActionDispatch::SSL and if it uses `Rack::Utils::HeaderHash`.
* | Routes resources avoid :new and :edit endpoints if api_only is enabledJorge Bejar2015-06-111-0/+75
| |
* | Remove extra whitespacesSantiago Pastorino2015-06-111-1/+1
| |
* | Remove Unneeded ApiPublicExceptions middleware, PublicExceptions already ↵Santiago Pastorino2015-06-111-37/+0
| | | | | | | | does the work
* | Add ApiPublicException middlewareSantiago Pastorino2015-06-111-2/+39
| |
* | Change the `index` arg of `ActionDispatch::Static#new` to a kwargYuki Nishijima2015-06-111-1/+1
| |
* | Remove `assigns` and `assert_template`.Guo Xiang Tan2015-05-301-110/+0
| |
* | config.static_index configures directory index "index.html" filenameEliot Sykes2015-05-281-0/+14
| | | | | | | | | | | | Set `config.static_index` to serve a static directory index file not named `index`. For example, to serve `main.html` instead of `index.html` for directory requests, set `config.static_index` to `"main"`.
* | Add assertion for get? method into test casesMehmet Emin İNAÇ2015-05-271-0/+1
| |
* | Prefer assert_not over refuteRafael Mendonça França2015-05-181-1/+1
| |
* | ActionDispatch::Journey::Routes#empty? test casesValentine Valyaeff2015-05-191-0/+14
| |
* | Fix rake routes for api appsJorge Bejar2015-04-251-0/+16
| | | | | | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* | Use `silence_warnings` on `StaticTests`eileencodes2015-04-141-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | When 7e504927 was merged setting `Encoding.default_internal` and `Encoding.default_external` would throw a warning when the ActionPack tests were run. Example warning: `actionpack/test/dispatch/static_test.rb:12: warning: setting Encoding.default_external` This patch silences the warnings as other similar tests do for setting default_internal and default_external.
* | [Rails4 regression] prevent thin and puma cause error in Non ASCII URL on ↵Toshi MARUYAMA2015-04-091-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows * https://github.com/rails/rails/issues/19187 * https://github.com/rails/rails/pull/19533 * https://github.com/macournoyer/thin/issues/268 These are serious Rails 4 regression for Redmine Bitnami Windows users. https://community.bitnami.com/t/problems-with-3-0-1-installation-see-report-inside/30195/ It is not caused on webrick users. Related: * https://github.com/rack/rack/issues/732#issuecomment-67677272 * https://github.com/phusion/passenger/issues/1328
* | sort_by instead of sortYang Bo2015-04-081-0/+13
| | | | | | | | | | | | it is avoid sort errot within different and mixed keys. used `sort_by` + `block` to list parameter by keys. keep minimum changes
* | Define a setup method instead of using setup as blockRafael Mendonça França2015-03-271-1/+2
| | | | | | | | | | setup as block run before setup actlually runs so it will fail for our case
* | Provide friendlier access to request variantsGeorge Claghorn2015-03-241-19/+30
| | | | | | | | Closes #18933.
* | Fix handling of empty X_FORWARDED_HOST header.adam2015-03-201-0/+3
|/ | | | | | Previously, an empty X_FORWARDED_HOST header would cause Actiondispatch::Http:URL.raw_host_with_port to return nil, causing Actiondispatch::Http:URL.host to raise a NoMethodError.
* Merge pull request #19309 from f1sherman/dont-set-session-options-idGuillermo Iguaran2015-03-123-4/+4
|\ | | | | Use request.session.id instead of request.session_options[:id]
| * Use request.session.id instead of request.session_options[:id]Brian John2015-03-123-4/+4
| | | | | | | | | | | | | | | | | | As of the upgrade to Rack 1.5, request.session_options[:id] is no longer populated. Reflect this change in the tests by using request.session.id instead. Related change in Rack: https://github.com/rack/rack/commit/83a270d6
* | Also skip Content-Encoding and Vary header if 304Kohei Suzuki2015-03-121-1/+2
| |
* | 304 response should not include Content-Type headerKohei Suzuki2015-03-101-0/+9
|/ | | | | Rack::Lint raises an error saying "Content-Type header found in 304 response, not allowed".
* Revert "Revert integration test refactoring that caused app test regressions"eileencodes2015-03-091-4/+0
| | | | This reverts commit 714205988315d2f98aa3e749747c44470e18676b.
* Drop request class from RouteSet constructor.Aaron Patterson2015-03-041-1/+5
| | | | | If you would like to use a custom request class, please subclass and implemet the `request_class` method.
* Merge pull request #19147 from gsamokovarov/work-around-ruby-10695Eileen M. Uchitelle2015-03-021-1/+1
|\ | | | | Work around for upstream Ruby bug #10685
| * 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') ```
* | Avoid accurate assertions on error messagesRobin Dupret2015-03-021-2/+2
|/ | | | | Since there are disparities between the raised error messages on the different implementations, let's avoid being too accurate.
* 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.
* Revert "Merge pull request #18764 from tsun1215/master"Jeremy Kemper2015-02-261-4/+5
| | | | | This reverts commit b6dd0c4ddebf5e7aab0a669915cb349ec65e5b88, reversing changes made to de9a3748c436f849dd1877851115cd94663c2725.
* Merge pull request #18434 from brainopia/change_filter_on_rails_info_routesRichard Schneeman2015-02-261-8/+0
|\ | | | | Change filter on /rails/info/routes to use an actual path regexp from rails
| * Change filter on /rails/info/routes to use an actual path regexp from railsbrainopia2015-02-231-8/+0
| | | | | | | | | | | | | | | | Change filter on /rails/info/routes to use an actual path regexp from rails and not approximate javascript version. Oniguruma supports much more extensive list of features than javascript regexp engine. Fixes #18402.
* | Add a failing test demonstrating regression with HEAD requests to Rack apps, ↵Jeremy Kemper2015-02-241-3/+9
|/ | | | re #18764
* Prefer request_id over uuid and test the aliasRafael Mendonça França2015-02-201-4/+8
|
* Merge pull request #18218 from brainopia/fix_match_shorthand_in_routesRafael Mendonça França2015-02-201-0/+9
|\ | | | | Don't use shorthand match on routes with inappropriate symbols
| * Improve shorthand matching for routesbrainopia2015-01-251-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shorthand route match is when controller and action are taken literally from path. E.g. get '/foo/bar' # => will use 'foo#bar' as endpoint get '/foo/bar/baz' # => will use 'foo/bar#baz' as endpoint Not any path with level two or more of nesting can be used as shortcut. If path contains any characters outside of /[\w-]/ then it can't be used as such. This commit ensures that invalid shortcuts aren't used. ':controller/:action/postfix' - is an example of invalid shortcut that was previosly matched and led to exception: "ArgumentError - ':controller/:action' is not a supported controller name"
* | lazily create the integration sessionAaron Patterson2015-02-121-4/+0
| | | | | | | | now we don't have to call reset! everywhere
* | Explicitly ignored wildcard verbs from head_routesTerence Sun2015-02-081-0/+12
| | | | | | | | | | | | In match_head_routes, deleted the routes in which request.request_method was empty (matches all HTTP verbs) when responding to a HEAD request. This prevents catch-all routes (such as Racks) from intercepting the HEAD request. Fixes #18698
* | Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-032-2/+0
| | | | | | | | onwards.
* | Show proper traces on Windows for the error pagesGenadi Samokovarov2015-02-011-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an issue brought up by @daniel-rikowski in rails/web-console#91. Citing his PR proposal here: > Prior to this, backtrace lines were simply split by a single colon. > > Unfortunately that is also the drive letter delimiter in Windows paths > which resulted in a lot of empty source fragments of "C:0". ("C" from > the drive letter and 0 from "/path/to/rails/file.rb:16".to_i) > > Now the trace line is split by the first colon followed by some digits, > which works for both Windows and Unix path styles. Now, the PR was sent against web-console, because of the templates copy issue we used to had. Instead of bothering the contributor to reopen the issue against upstream Rails itself, I will make sure he gets the credit by putting his name in [rails-contributors/hard_coded_authors.rb][]. [rails-contributors/hard_coded_authors.rb]: (https://github.com/fxn/rails-contributors/blob/master/app/models/names_manager/hard_coded_authors.rb).
* | Consistent usage of spaces in hashes across our codebaseRafael Mendonça França2015-01-2911-53/+53
| |