| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Puma is the default webserver of Rails. Because of this it doesn't make
sense to run tests in Webkit if the default server is Puma.
Here I've refactored the webserver to be it's own standalone module so
it can be shared between Rails' selenium default driver and Capybara's
defaut drivers.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change adds support, tests, and documentation for the screenshot
helper.
If taking screenshots is supported by the driver (for example Rack Test
doesn't support screenshots) then a screenshot will be taken if the test
fails.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This removes the useless Rack Test Driver that Rails was providing and
moves to a shim like approach for default adapters.
If someone wants to use one of the default Capybara Drivers then we will
initialize a new `CapybaraDriver` that simply sets the default driver.
Rails though is much more opinionated than Capybara and to make system
testing a "works out of the box" framework in Rails we have the
`RailsSeleniumDriver`. This driver sets defaults that Rails deems
important for selenium testing. The purpose of this is to simply add a
test and it just works.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Document Rails::SystemTestCase
* Document setting drivers with the configration options
* Document using the getter/setter for driver adapters
* Document the CapybaraRackTestDriver and defaults
* Document the CapybaraSeleniumDriver and defaults
* Document custom assertions provided by System Testing
* Document custom form helpers provided by System Testing
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This will clean up the railtie quite a bit, rather than passing a set of
hash keys call the new class directly like we do with ActiveJob.
Only call driver once when tests start rather than in every single test
setup. This is more performant, and the other way was creating
unnecessary calls.
|
| |
| |
| |
| |
| | |
There's no real benefit to the using the `Base` class here because
`SystemTestCase` is already a very small class.
|
| |
| |
| |
| |
| |
| |
| | |
Rails itself is not a Rails application so instead of including
`capybara/rails` we should use the code in there to set up the test. The
only reason capybara needs to include capybara/rails in the first place
is because Rails didn't yet support it.
|
| |
| |
| |
| |
| |
| | |
This makes it easier to ask the system test what driver adapter it is
currently using, and makes it easier to change that setting when
necessary.
|
| |
| |
| |
| |
| |
| |
| | |
Integration tests already handle all the fancy url mapping we need to do
so inherting from that allows us to not need to reinvent the wheel in
terms of loading up the route handling required to use `visit
users_path` over `visit /users`.
|
| |
| |
| |
| |
| | |
Adds assertions that are not part of Capybara but may be useful to Rails
users writing system tests.
|
| |
| |
| |
| |
| | |
This allows any application to change the driver adapter based on the
config settings in the test env.
|
| |
| |
| |
| |
| | |
These FormHelpers are selectors that aren't a capybara default but are
considered useful for Rails applications.
|
| |
| |
| |
| |
| |
| |
| | |
This is not yet configurable but is the minimum required to make
Capybara work with the Selenium driver. A lot of this will change as the
tests get fleshed out and the initialization requirements will eventually
be configurable via the application.
|
| |
| |
| |
| |
| |
| | |
Capybara defaults to Rack Test for it's driver and works out of the box
but this adds the headers and allows for future configurable adapters
for system testing.
|
|/
|
|
|
|
|
| |
This skelton is the bare minimum to get system tests to actually run in
an application. This of course doesn't yet actually run a test but it is
enough for `bin/rails test:system` to attempt to run files in
`test/system` that inherit from `Rails::SystemTestCase`.
|
| |
|
|\
| |
| | |
Freeze fragment cache related instrument name.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ActionMailer::Base#instrument_name and
ActionController::Base#instrument_name will be frequently called once
caching is enabled. So it's better to freeze them instead of create new
string on every call.
Also, the instrument name in #instrument_fragment_cache will usually
be "write_fragment.action_controller" or
"read_fragment.action_controller". So freezing them might also gain some
performance improvement. We have done something like this in other places:
https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
|
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Erubi offers the following advantages for Rails:
* Works with ruby's --enable-frozen-string-literal option
* Has 88% smaller memory footprint
* Does no freedom patching (Erubis adds a method to Kernel)
* Has simpler internals (1 file, <150 lines of code)
* Has an open development model (Erubis doesn't have a
public source control repository or bug tracker)
* Is not dead (Erubis hasn't been updated since 2011)
Erubi is a simplified fork of Erubis that contains just the
parts that are generally needed (which includes the parts
that Rails uses). The only intentional difference in
behavior is that it does not include support for <%=== tags
for debug output. That could be added to the ActionView ERB
handler if it is desired.
The Erubis template handler remains in a deprecated state
so that code that accesses it directly does not break. It
can be removed after Rails 5.1.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Prevents PATH_INFO from being used to infer the request format in later
test requests when no explicit format is given.
As the request PATH_INFO may be set before a request, it can't be
deleted during pre-request scrubbing.
Fixes #27774
|
| |
| |
| |
| | |
#27715 [ci skip] (#27730)
|
| |
| |
| |
| | |
[26dd9b26ab7317f94fd285245879e888344143b2] as it broke Parameters#to_h on at least fields_for-style nested params.
|
| |
| |
| |
| | |
This was preventing the test suite from being run in isolation
|
| |
| |
| |
| | |
call `super`
|
| |
| |
| |
| |
| |
| | |
it has some methods that override the accessors and calls the original accessors via `super`
this partially reverts 9360b6be63b7a452535699bcf6ae853df7f5eea7
|
| |
| |
| |
| | |
because Struct.new returns a Class, we just can give it a name and use it directly without inheriting from it
|
| |
| |
| |
| | |
`ActionController::Renderer.defaults` was removed in 2db7304
|
| |
| |
| |
| | |
(I personally prefer writing one string in one line no matter how long it is, though)
|
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 5eff7a9ca7bb2ee7f16db1ab4d11cebe28757ba5, reversing
changes made to 5f03172f54a58a57a48a3121562beb2cef866cbe.
Reason: It caused a regression. The test case is on the PR.
|
|/ |
|
|
|
|
| |
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]
|
|
|
|
|
|
|
|
|
| |
Regression introduced by ae29142142324545a328948e059e8b8118fd7a33 / 8363b879fe759f0645179f4521cc64795efbee6e.
Previously, cookies were only updated on `GET` requests. Now we will
update the helper for all requests, as part of `process`. Added
regression tests for all available HTTP method helpers in
`ActionController::TestCase`.
|
|
|
|
| |
Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Provide an API interface similar to how format is handled in
Controllers. In situations where variants are not needed (ex: in
Action Mailer) the method will simply trigger a no-op, and will not
affect end users.
|
|
|
|
|
|
|
|
| |
Per https://www.timeanddate.com/counters/firstnewyear.html, it's already
2017 in a lot of places, so we should bump the Rails license years to
2017.
[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.
|
| |
|