aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
Commit message (Collapse)AuthorAgeFilesLines
...
* | pull `to` upAaron Patterson2015-08-111-1/+1
| | | | | | | | | | this way we don't have to insert / delete it from the options hash so many times.
* | push option decomposition up a bit moreAaron Patterson2015-08-111-2/+2
| | | | | | | | | | I think we can find the original place where `action` is added to the options hash now.
* | pull up the "options.delete(:controller)" logicAaron Patterson2015-08-111-2/+2
| | | | | | | | | | | | we want to try to pull this logic up to where the user actually passed in "controller" so that it's close to the related call. That way when we're down the stack, we don't need to wonder "why are we doing this?"
* | Merge pull request #11352 from xaviershay/dispatcher-apiRafael Mendonça França2015-08-082-9/+10
|\ \ | | | | | | Allow a custom dispatcher to be provided to routing.
| * | Allow a custom dispatcher to be provided to routing.Xavier Shay2015-08-072-9/+10
| | |
* | | Fix deprecation warning in testseileencodes2015-08-081-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Using the string version of the class reference is now deprecated when referencing middleware. This should be written as a class not as a string. Deprecation warning that this change fixes: ``` DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change them to actual class references. For example: "ActionDispatch::ShowExceptions" => ActionDispatch::ShowExceptions ```
* | finish deprecating handling strings and symbolsAaron Patterson2015-08-074-60/+19
| | | | | | | | | | since we only work with instances of classes, it greatly simplifies the `Middleware` implementation.
* | Using strings or symbols for middleware class names is deprecated.Aaron Patterson2015-08-072-23/+19
| | | | | | | | | | | | | | | | | | | | Convert things like this: middleware.use "Foo::Bar" to this: middleware.use Foo::Bar
* | simplify the Middleware constructorAaron Patterson2015-08-071-39/+24
| | | | | | | | | | | | We should do the hard work outside the constructor. Also fix the tests to not directly construct middleware objects, but to go through the stack object.
* | ExceptionWrapper doesn't need to know about `env`Aaron Patterson2015-08-061-17/+15
| | | | | | | | | | | | ExceptionWrapper only cares about the backtrace cleaner, so lets just pass the cleaner to the wrapper. It does not need to know that env exists or what key the backtrace cleaner is stored in
* | use a request object to reduce string allocations and not know about ENV keysAaron Patterson2015-08-061-1/+1
| |
* | Merge pull request #21131 from eagletmt/percent-filenameRafael Mendonça França2015-08-061-0/+11
|\ \ | | | | | | Fix Encoding::UndefinedConversionError with multibyte UTF-8 filename containing "%" character
| * | Add failing spec on utf8 filename with percent characterKohei Suzuki2015-08-041-0/+11
| | |
* | | Adds missing argument handling for ActionController::TestSession toMatthew Gerrior2015-08-061-0/+10
|/ / | | | | | | allow testing controllers that use session#fetch with a default value.
* | 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
* | | Stop using deprecated `render :text` in testPrem Sichanugrist2015-07-177-29/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will silence deprecation warnings. Most of the test can be changed from `render :text` to render `:plain` or `render :body` right away. However, there are some tests that needed to be fixed by hand as they actually assert the default Content-Type returned from `render :body`.
* | | Skip a few failing tests on JRuby with the attached ticketsRobin Dupret2015-07-172-0/+4
| | |
* | | Make AC::Parameters not inherited from HashPrem Sichanugrist2015-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This is another take at #14384 as we decided to wait until `master` is targeting Rails 5.0. This commit is implementation-complete, as it guarantees that all the public methods on the hash-inherited Parameters are still working (based on test case). We can decide to follow-up later if we want to remove some methods out from Parameters.
* | | Merge pull request #20866 from jdantonio/countdown-latchAaron Patterson2015-07-141-7/+7
|\ \ \ | | | | | | | | Replace `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch` from concurrent-ruby.
| * | | Replaced `ActiveSupport::Concurrency::Latch` with concurrent-ruby.Jerry D'Antonio2015-07-131-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The concurrent-ruby gem is a toolset containing many concurrency utilities. Many of these utilities include runtime-specific optimizations when possible. Rather than clutter the Rails codebase with concurrency utilities separate from the core task, such tools can be superseded by similar tools in the more specialized gem. This commit replaces `ActiveSupport::Concurrency::Latch` with `Concurrent::CountDownLatch`, which is functionally equivalent.
* | | | only call methods that are on the superclassAaron Patterson2015-07-141-4/+3
|/ / / | | | | | | | | | | | | | | | We want to treat the response object as if it's a real response object (not a test object), so we should only call methods that are on the superclass.
* | | 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]