| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
Rubocop / code climate don't like single quotes and prefer doubles.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Adds test case test
* Adds driver adapter test
* Adds tests for capybara seleium driver (testing the settings not
actually opening the browser to test capybara w/ selenium because that
would so so so slow)
* Adds tests for rack test driver
* Adds tests for generators
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
| |
empty lines
|
|
|
|
|
|
|
| |
```
go get -u github.com/client9/misspell/cmd/misspell
misspell -w -error -source=text .
```
|
|
|
|
| |
since the test names become Regexp filters, non-escaped test names cause RegexpError on isolated test via bin/test
|
| |
|
|\
| |
| | |
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)
|
| |
| |
| |
| |
| |
| |
| |
| | |
Mixing Rack::Test::Methods into ActionDispatch::IntegrationTest seems
to trigger Ruby bug 13107[1]. By using our methods instead of rack-test
we shouldn't trigger the bug in Forwardable.
[1]: https://bugs.ruby-lang.org/issues/13107
|
| | |
|
| |
| |
| |
| |
| |
| | |
These are followups for 307065f959f2b34bdad16487bae906eb3bfeaf28,
but TBH I'm personally not very much confortable with this style.
Maybe we could override assert_equal in our test_helper not to warn?
|
| | |
|
| |
| |
| |
| | |
we call them only in the tests
|
|\ \
| | |
| | | |
make `render` work with AC::Params
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In 4.2, since AC::Params inherited `Hash`, processing in the case of
`Hash` was done. But in 5.x, since AC::Params does not inherit `Hash`,
need to add care for AC::Params.
Related to 00285e7cf75c96553719072a27c27e4ab7d25b40
|
| | |
| | |
| | |
| | | |
the speed-up from 26dd9b26ab7317f94fd285245879e888344143b2 (cc: @fxn)
|
| | |
| | |
| | |
| | | |
[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`
|
| |
| |
| | |
existing_acrnoyms -> existing_acronyms
|
| |
| |
| |
| |
| |
| | |
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)
|
|\ \
| | |
| | | |
Fix inconsistent parsing of Durations with both months and years
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
durations from code
ActiveSupport::Duration.parse('P3Y') == 3.years # It should be true
Duration parsing made independent from any moment of time:
Fixed length in seconds is assigned to each duration part during parsing.
Changed duration of months and years in seconds to more accurate and logical:
1. The value of 365.2425 days in Gregorian year is more accurate
as it accounts for every 400th non-leap year.
2. Month's length is bound to year's duration, which makes
sensible comparisons like `12.months == 1.year` to be `true`
and nonsensical ones like `30.days == 1.month` to be `false`.
Calculations on times and dates with durations shouldn't be affected as
duration's numeric value isn't used in calculations, only parts are used.
Methods on `Numeric` like `2.days` now use these predefined durations
to avoid duplicating of duration constants through the codebase and
eliminate creation of intermediate durations.
|