aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
Commit message (Collapse)AuthorAgeFilesLines
...
* | | make the routes reader privateAaron Patterson2015-08-181-1/+1
| | | | | | | | | | | | | | | nobody should be touching the routes hash without going through the NamedRouteCollection object.
* | | routes are always constructed with a hash for the conditionsAaron Patterson2015-08-171-2/+2
| | |
* | | pass pass the mapping object down the add_route stackAaron Patterson2015-08-141-1/+1
| | | | | | | | | | | | | | | then we can let the mapping object derive stuff that the Route object needs.
* | | pass the mapping object to build_routeAaron Patterson2015-08-141-16/+5
| | | | | | | | | | | | | | | now that we aren't doing options manipulations, we can just pass the mapping object down and read values from it.
* | | deprecate passing a string for both the beginning path and :path optionAaron Patterson2015-08-141-1/+4
| | |
* | | pass the path ast downAaron Patterson2015-08-141-1/+1
| | | | | | | | | | | | | | | now we don't need to add it to a hash and delete it from the hash later just to pass it around
* | | pull up path parsingAaron Patterson2015-08-141-1/+2
| | | | | | | | | | | | | | | `add_route` needs the AST, so rather than shove it in a hash and delete later, lets move parsing up the stack so we can pass down later
* | | use predicate methods instead of hard coding verb stringsAaron Patterson2015-08-141-1/+2
| | | | | | | | | | | | | | | also change the feeler to subclass AD::Request so that it has all the methods that Request has
* | | implement `requirements` in terms of routesAaron Patterson2015-08-141-1/+1
| | |
* | | implement the `asts` method in terms of paths / patternsAaron Patterson2015-08-141-12/+11
| | | | | | | | | | | | Eventually I want to eliminate the FakeSet test class
* | | extract ast finding to a methodAaron Patterson2015-08-141-9/+13
| | | | | | | | | | | | | | | I'm going to reimplement this using route objects, so it will be easier if we just change ast access to go through a method rather than hashes
* | | stop adding path_info to the conditions hashAaron Patterson2015-08-141-9/+9
| | | | | | | | | | | | we don't need to keep adding it and deleting if from hashes.
* | | pull up options_constrants extractionAaron Patterson2015-08-131-1/+1
| | |
* | | remove `as`Aaron Patterson2015-08-131-1/+1
| | | | | | | | | | | | the caller already has access to `as`, so we can stop passing it around.
* | | remove anchor from mappingAaron Patterson2015-08-131-1/+1
| | | | | | | | | | | | | | | | | | the same value that is extracted from the options hash earlier is returned, so we don't need to pass it in in the first place. The caller already has the data, so stop passing it around.
* | | pull `anchor` extraction upAaron Patterson2015-08-131-1/+1
| | | | | | | | | | | | | | | this way we don't have to mutate the options hash so far away from where the user passed it in
* | | raise if `anchor` is passed to `scope`Aaron Patterson2015-08-131-0/+9
| | | | | | | | | | | | | | | | | | The `anchor` parameter [is overridden](https://github.com/rails/rails/blob/b4b4a611d0eb9aa1c640c5f521c6a43bf2a65bab/actionpack/lib/action_dispatch/routing/mapper.rb#L1528) unless it is directly passed to `match`, so setting it in a scope must be a mistake.
* | | pull `formatted` up the stackAaron Patterson2015-08-121-1/+10
| | | | | | | | | | | | this reduces the number of times we have to mutate the options hash.
* | | add a regression test for scoped `format` paramsAaron Patterson2015-08-121-0/+11
| | | | | | | | | | | | This just ensures that `format` is applied to things inside the scope
* | | add a regression test for adding arbitrary keys to `scope`Aaron Patterson2015-08-121-0/+15
| | |
* | | add a method to `Scope` for getting mapping optionsAaron Patterson2015-08-121-1/+2
| | | | | | | | | | | | | | | Eventually we don't want to expose the "options" hash from scope, only read values from it. Lets start by adding a reader method.
* | | pull `via` all the way out of `add_route`Aaron Patterson2015-08-121-0/+8
| | |
* | | add a test for adding "via" using `scope`Aaron Patterson2015-08-121-0/+9
| | |
* | | pull `via` extraction upAaron Patterson2015-08-121-2/+2
| | | | | | | | | | | | | | | | | | We're going to try pulling this up further, and check `via` validity sooner. This way we don't have to do a bunch of processing on `options` hashes only to find out that the route is incorrect
* | | 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