| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Haven't diagnosed yet. No similarly failing tests in Rails to work from.
cc @tenderlove, @eileencodes
Revert "there is always an integration session, so remove the check"
Revert "lazily create the integration session"
Revert "use before_setup to set up test instance variables"
This reverts commits 4cf3b8ac47f109fa83a6f66eb97d6cb0eace0d05, 303567e554de26822f3107be55c471d6477a745f, and fa63448420d3385dbd043aca22dba973b45b8bb2.
|
|
|
|
|
|
|
| |
Fixes regression in #18423. Merge default headers for new responses,
but don't merge when creating a response from the last session request.
hat tip @senny :heart:
|
|\
| |
| | |
Allow `method: "all"` as a valid routing test option
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This allows the test to mirror the production code, since `via: :all` is
a valid option. The behavior in 4.1 did not actually test that it
matched all verbs, but instead defaulted to testing for "GET". This
implementation aims to better handle the intention of passing "all".
What will actually be asserted doesn't quite match up with the generated
route, since it appears to just not create a constraint on the method.
However, I don't think that we can easily test the lack of that
constraint. Testing each of the main 4 HTTP verbs seems to be a
reasonably close approximation, which should be sufficient for our
needs.
Fixes #18511.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
there's really no benefit here. It's the same number of lines without
the meta programming and is faster
|
| | |
|
| |
| |
| |
| | |
now we don't have to call reset! everywhere
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We shouldn't cache if it's not absolutely necessary. Removes
route caching and instead skips using the `url_helpers` is the
integration test session doesn't require it. Benchmark ips on
integration and controller index method tests below.
Without any caching or changes to `#url_helpers`:
```
Calculating -------------------------------------
INDEX: Integration Test
71.000 i/100ms
INDEX: Functional Test
99.000 i/100ms
-------------------------------------------------
INDEX: Integration Test
728.878 (± 8.0%) i/s - 3.692k
INDEX: Functional Test
1.015k (± 6.7%) i/s - 5.148k
Comparison:
INDEX: Functional Test: 1015.4 i/s
INDEX: Integration Test: 728.9 i/s - 1.39x slower
```
With caching on `#url_helpers`:
```
Calculating -------------------------------------
INDEX: Integration Test
74.000 i/100ms
INDEX: Functional Test
99.000 i/100ms
-------------------------------------------------
INDEX: Integration Test
752.377 (± 6.9%) i/s - 3.774k
INDEX: Functional Test
1.021k (± 6.7%) i/s - 5.148k
Comparison:
INDEX: Functional Test: 1021.1 i/s
INDEX: Integration Test: 752.4 i/s - 1.36x slower
```
Afer removing the caching and bypassing the `url_helpers` when not
necessary in the session:
```
Calculating -------------------------------------
INDEX: Integration Test
87.000 i/100ms
INDEX: Functional Test
97.000 i/100ms
-------------------------------------------------
INDEX: Integration Test
828.433 (± 6.4%) i/s - 4.176k
INDEX: Functional Test
926.763 (± 7.2%) i/s - 4.656k
Comparison:
INDEX: Functional Test: 926.8 i/s
INDEX: Integration Test: 828.4 i/s - 1.12x slower
```
|
|\ \
| | |
| | | |
Migrating xhr methods to keyword arguments syntax
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
in `ActionController::TestCase` and
`ActionDispatch::Integration`
Old syntax:
`xhr :get, :create, params: { id: 1 }`
New syntax example:
`get :create, params: { id: 1 }, xhr: true`
|
|/ /
| |
| |
| | |
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Non-kwargs requests are deprecated now.
Guides are updated as well.
`post url, nil, nil, { a: 'b' }` doesn't make sense.
`post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
|
|/ |
|
|
|
|
| |
test response.
|
| |
|
|
|
|
|
|
|
|
| |
existing example. [ci skip]
My reasoning is that this is probably too much information for the complete
Rails testing guide, as we're trying to cover testing all aspects of the
framework.
|
| |
|
|
|
| |
They were introduced in 23b6def; the serial stuff has been removed since a5d80f8
|
|
|
|
|
|
|
|
|
| |
This reverts commit f93df52845766216f0fe36a4586f8abad505cac4, reversing
changes made to a455e3f4e9dbfb9630d47878e1239bc424fb7d13.
Conflicts:
actionpack/lib/action_controller/test_case.rb
actionview/lib/action_view/test_case.rb
|
|
|
|
| |
When calling assigns(:...) or cookies(:...), template assertions would be reset, which they obviously shouldn't be.
|
|
|
|
| |
Fixes: https://github.com/rails/rails/issues/16814
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch uniformizes warning messages. I used the most common style
already present in the code base:
* Capitalize the first word.
* End the message with a full stop.
* "Rails 5" instead of "Rails 5.0".
* Backticks for method names and inline code.
Also, converted a few long strings into the new heredoc convention.
|
|
|
|
| |
This is to match the changes in Rails Dom Testing rails/rails-dom-testing#20.
|
|
|
|
| |
[ci skip]
|
|
|
|
| |
- [ci skip]
|
| |
|
| |
|
|\
| |
| |
| | |
Propagate test messages through assert_routing helper, Fixes #14908
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
assert_routing was not raising the message passed into the assertion
violation that it raised. This change propagates messages through
the on_fail error.
This fixes this error:
https://github.com/rails/rails/issues/14908
A test case for this issue is located here.
https://github.com/estsauver/test14908
To see that test case fail in the example app, just run
ruby -Itest test/controllers/guests_controller_test.rb
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
actionpack/CHANGELOG.md
actionpack/test/controller/integration_test.rb
actionview/CHANGELOG.md
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This reverts commit f632f79b8dcd144408c66a544984b2ba9cf52f87, reversing
changes made to 98c7fe87690ca4de6c46e8f69806e82e3f8af42d.
Closes #16343
|
| | |
| | |
| | |
| | |
| | | |
we should not be accessing internals to figure out if a method is
defined.
|
| | |
| | |
| | |
| | | |
Fixes https://github.com/rails/rails/issues/16119.
|
| | | |
|
| | |
| | |
| | |
| | | |
We can just use nokogiri
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | | |
Loofah-integration
Conflicts:
actionpack/CHANGELOG.md
actionview/CHANGELOG.md
|
| | |
| | |
| | |
| | | |
assert_select can be called without specifying a root.
|
| | |
| | |
| | |
| | | |
Rails::Dom::Testing::Assertions there as well.
|
| | | |
|
| | | |
|