| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| | |
Previously, `driven_by` would change the Capybara configuration when
the test case is loaded, and having multiple test classes with different
`driven_by` configs would fail as the last loaded would be effective.
|
| |
| |
| |
| |
| | |
The documentation needs to be above the method to correctly document the
method.
|
| | |
|
| |
| |
| |
| | |
Also correct use of `direct class:` to `resolve` in example.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since a `direct` url helper block is evaluated using `instance_exec`
then methods that are available in the instance context can be
accessed, e.g. the params object in a controller action or view.
This wasn't clear from the example so expand on that point and add
a test case for this situation.
|
| | |
|
| |
| |
| |
| | |
Use double quoted strings, come down hard on some typos.
|
| |
| |
| |
| |
| | |
Use a separate method called `resolve` for the custom polymorphic
mapping to clarify the API.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| | |
Using `undef_method` means that when a route is removed any other
implementations of that method in the ancestor chain are inaccessible
so instead use `remove_method` which restores access to the ancestor.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allow the use of `direct` to specify custom mappings for polymorphic_url, e.g:
resource :basket
direct(class: "Basket") { [:basket] }
This will then generate the following:
>> link_to "Basket", @basket
=> <a href="/basket">Basket</a>
More importantly it will generate the correct url when used with `form_for`.
Fixes #1769.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allow the definition of custom url helpers that will be available
automatically wherever standard url helpers are available. The
current solution is to create helper methods in ApplicationHelper
or some other helper module and this isn't a great solution since
the url helper module can be called directly or included in another
class which doesn't include the normal helper modules.
Reference #22512.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The singleton url_for on Rails.application.routes.url_helpers isn't the
same as the url_for you get when you include the module in your class as
the latter has support for polymorphic style routes, etc. whereas the
former accepts only a hash and is the underlying implementation defined
on ActionDispatch::Routing::RouteSet.
This commit changes the singleton method to call through a proxy instance
so that it gets the full range of features specified in the documentation
for url_for.
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
There were some grammar issues and incorrect information in the system
tests documentation.
|
| |
| |
| |
| |
| |
| | |
This renames the system test helper file to be application system test
case to match what the rest of Rails does. In the future we should
consider changing the test_helper to match.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Override integration test default host
Integration tests automatically set the default host to
'http://example.com'. This works fine for integration tests because they
are not real browser sessions, but doesn't work fine for system tests
because they are real browser sessions.
We can override this by setting the `host!` in `before_setup. The
`Capybara.always_include_port` will allow the test to look at
`127.0.0.1:port capybara picks` and properly redirect the test.
Any application can override this by setting the `host!` in
their system test helper. Generally though, applications are going to be
using localhost.
In this commit I also moved the setup and teardown into their own module
for tidiness.
* Move teardown settings into system test case
These configuration options can be put into the system test case file
instead of the generated system tests helper file. This is an
implementation detail and therefore shouldn't be generated with the
template.
|
| |
| |
| |
| |
| | |
We only want the file name to include the word `failures` if it failed,
not any time the user wants to take a screenshot during a test run.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Move system tests back into Action Pack
* Rename `ActionSystemTest` to `ActionDispatch::SystemTestCase`
* Remove private base module and only make file for public
`SystemTestCase` class, name private module `SystemTesting`
* Rename `ActionSystemTestCase` to `ApplicationSystemTestCase`
* Update corresponding documentation and guides
* Delete old `ActionSystemTest` files
|
|/
|
|
|
|
|
|
|
|
| |
to be Hash
- Fixes issue described on #27944
- `filtered_query_string` used an Array representation of what
semantically is a key value pair: better suited for a Hash. Without
this change `filtered_params = original_params.class.new` returns an
Array with unintended consequences.
|
|
|
|
|
|
| |
These files are not using `strip_heredoc`.
Closes #27976
|
|
|
|
| |
- This file is no more needed, the call to `cattr_reader` were removed in https://github.com/rails/rails/commit/9e2948e750fa3f641f20adad4b4ecae89b35faa7#diff-c5146df11f35304765e9ceebed108f57L60 and https://github.com/rails/rails/commit/1fe0a1b5ebebb1372968606b85ce08b93bc145c8#diff-c5146df11f35304765e9ceebed108f57L99
|
|
|
|
|
|
|
| |
```
go get -u github.com/client9/misspell/cmd/misspell
misspell -w -error -source=text .
```
|
| |
|
|\
| |
| | |
Fully initialize routes before the first request is handled
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`AD::Journey::GTG::Simulator` is lazily built the first time
`Journey::Router#find_routes` is invoked, which happens when
the first request is served.
On large applications with many routes, building the simulator
can take several hundred milliseconds (~700ms for us).
Triggering this initialization during the boot process reduces
the impact of deploys on the application response time.
|
| |
| |
| |
| | |
#27715 [ci skip] (#27730)
|
| |
| |
| |
| | |
This was preventing the test suite from being run in isolation
|
| |
| |
| |
| | |
call `super`
|
| |
| |
| |
| | |
because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
|
| |
| |
| |
| | |
(I personally prefer writing one string in one line no matter how long it is, though)
|
|/ |
|
|
|
|
| |
than a ruby encoding
|
| |
|
|
|
|
|
|
|
| |
It is the proper way to configure custom parameters parser and it was
being recommended in the deprecation for ActionDispatch::ParamsParser.
[ci skip]
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We want to avoid terminating the whole loop here, because it will cause
parameters that should be removed to not be removed, since we are
terminating early. In this specific case, `param2` is processed before
`param1` due to the reversing of `route.parts`, and since `param2` fails
the check on this line, it would previously cause the whole loop to
fail, and `param1` would still be in `parameterized_parts`. Now, we are
simply calling `next`, which is the intended behavior.
Introduced by 8ca8a2d773b942c4ea76baabe2df502a339d05b1.
Fixes #27454.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Documentation for ActionDispatch::Request#key? [ci skip]
Update request.rb --ci skip
Documentation for ActionDispatch::Request#key? [ci skip]
Also made change after the review by @rafaelfranca .
Update request.rb --ci skip
Documentation for ActionDispatch::Request#key? [ci skip]
Also made change after the review by @rafaelfranca .
Update request.rb --ci skip
|
|
|
|
|
|
| |
Some methods were added to public API in
5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of
the public API.
|
|
|
|
|
|
|
|
| |
Scoring routes based on constraints repeated many type conversions that
could be performed in the outer loop. Determinations of score and
fitness also used Array operations that required allocations. Against
my benchmark with a large routeset, this reduced object allocations by
over 30x and wall time by over 3x.
|