| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Also, refactor logic to convert between symbol and response code,
via the AssertionResponse class
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow-up to PR #19977, which helpfully added the redirection path to the error message of assert_response if response is a redirection, but which removed the response code, obscuring the type of redirect.
This PR:
- brings back the response code in the error message,
- updates the tests so the new messages can be tested,
- and adds test cases for the change.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- `assert_predicate` appends its own error message at the end of message
generated by `assert_response` and because of that the error message
displays the whole `response` object.
- For eg.
Expected response to be a <success>, but was a redirect to <http://test.host/posts>.
Expected #<ActionDispatch::TestResponse:0x007fb1cc1cf6f8....(lambda)>}>> to be successful?.
- Complete message can be found here -
https://gist.github.com/prathamesh-sonpatki/055afb74b66108e71ded#file-gistfile1-txt-L19.
- After this change the message from `assert_predicate` won't be
displayed and only message generated by `assert_response` will be shown
as follows:
Expected response to be a <success>, but was a redirect to <http://test.host/posts>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
:redirect
- If the assert_response is checking for any non-redirect response like
:success and actual response is :redirect then, the error message displayed
was -
Expected response to be a <success>, but was <302>
- This commit adds the redirect path to the error message of
assert_response if the response is :redirect.
So above message is changed to -
Expected response to be a <success>, but was a redirect to <http://test.host/posts/lol>
|
| |
|
|
|
|
|
| |
‘Asserts’ at all places [ci skip]
Following commit https://github.com/rails/docrails/commit/495722a95687e25114ae75608dd3107ac5d6611b
|
| |
|
|
|
|
|
|
| |
`extra_keys` is a confusing variable name because it's not clear what is
"extra". This renames it to `query_string_keys` so it's clear that the
"extra" is just the query string.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
We shouldn't depend on specific methods imlemented in the TestResponse
subclass because the response could actually be a real response object.
In the future, we should either push the aliased predicate methods in
TestResponse up to the real response object, or remove them
|
| |
|
| |
|
|
|
|
|
| |
We should leverage the request / response objects that the superclass
has already allocated for us.
|
|\
| |
| | |
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.
|
|/
|
|
| |
ref: https://github.com/rails/rails/pull/18763#issuecomment-72349769
|
| |
|
|
|
| |
They were introduced in 23b6def; the serial stuff has been removed since a5d80f8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
[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
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
we should not be accessing internals to figure out if a method is
defined.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
<encoded> wrapper. Updated tests to reflect this.
|
| | |
| | |
| | |
| | | |
tested anywhere.
|
| | |
| | |
| | |
| | | |
substitution values.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
without it.
|
| | |
| | |
| | |
| | | |
via default xml namespaces didn't work.
|
| | |
| | |
| | |
| | | |
users don't have to care about enclosing values in double quotes.
|
| | |
| | |
| | |
| | | |
selector.message.
|
| | | |
|
| | |
| | |
| | |
| | | |
select.
|
| | | |
|