aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
Commit message (Collapse)AuthorAgeFilesLines
* default pattern to use a joined stringAaron Patterson2015-08-172-13/+15
| | | | | The string we create is almost always the same, so rather than joining all the time, lets join once, then reuse that string everywhere.
* use the mapper to build the routing tableAaron Patterson2015-08-152-231/+103
| | | | | | We should build the routes using the user facing API which is `Mapper`. This frees up the library internals to change as we see fit. IOW we shouldn't be testing internals.
* only keep one hash of named routesAaron Patterson2015-08-142-13/+14
| | | | | The outer router object already keeps a hash of named routes, so we should just use that.
* rm add_route2Aaron Patterson2015-08-142-41/+51
| | | | | refactor the tests with a backwards compatible method call so we can rm add_route2 from the journey router
* 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-142-6/+6
| | | | | 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.
* remove StrexpAaron Patterson2015-08-134-74/+61
| | | | | This was a useless object. We can just directly construct a Path::Pattern object without a Strexp object.
* pass anchor directly to `Pattern`Aaron Patterson2015-08-134-39/+38
| | | | | the caller already has it, there is no reason to pack it in to an object and just throw that object away.
* 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
* Merge pull request #21203 from denniss/issue-21199Sean Griffin2015-08-111-0/+8
|\ | | | | Authorization scheme should be case insensitive. Fixes #21199
| * Authorization scheme should be case insensitive. Fixes #21199Dennis Suratna2015-08-111-0/+8
| |
* | 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?"
* | Refactor route assertion methods in resources testeileencodes2015-08-081-50/+51
| | | | | | | | | | | | | | | | The tests and methods were hard to read with `options[:options]` all over the place. This refactoring makes the code easier to understand. The change came out of work for moving the underlying code of controller tests to integraiton tests.
* | Merge pull request #11352 from xaviershay/dispatcher-apiRafael Mendonça França2015-08-083-17/+14
|\ \ | | | | | | Allow a custom dispatcher to be provided to routing.
| * | Allow a custom dispatcher to be provided to routing.Xavier Shay2015-08-073-17/+14
| | |
* | | 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 ```
* | | Refactor to remove DrawOnce moduleeileencodes2015-08-081-27/+8
|/ / | | | | | | | | | | We were doing extra work that could be pushed off to Integration test and SharedRoutes. Creating an extra module isn't necessary when those are created by their respective classes.
* | remove vestigial codeAaron Patterson2015-08-071-43/+0
| | | | | | | | | | Looks like this was left over from converting Rails to Rack. I think it's safe to remove now.
* | finish deprecating handling strings and symbolsAaron Patterson2015-08-075-61/+20
| | | | | | | | | | 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-073-30/+26
| | | | | | | | | | | | | | | | | | | | 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.
* | do not add common ports to HTTP_HOSTMichael Grosser2015-08-061-0/+19
| | | | | | | | | | - webservers do not do it - it makes redirect urls ugly when request.host is used for redirection
* | 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-062-0/+21
|\ \ | | | | | | Fix Encoding::UndefinedConversionError with multibyte UTF-8 filename containing "%" character
| * | Add failing spec on utf8 filename with percent characterKohei Suzuki2015-08-042-0/+21
| |/
* / Adds missing argument handling for ActionController::TestSession toMatthew Gerrior2015-08-061-0/+10
|/ | | | allow testing controllers that use session#fetch with a default value.
* Add missing assertion for test_route_with_colon_firstAditya Kapoor2015-08-031-2/+4
|
* 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