| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the check is failed, print the actual response body if it's not too large.
This could improve productivity when writing new tests.
Before:
```
ThemeEditorIntegrationTest#test_whatever
Expected response to be a <200: ok>, but was a <422: Unprocessable Entity>.
Expected: 200
Actual: 422
```
After:
```
ThemeEditorIntegrationTest#test_whatever
Expected response to be a <200: ok>, but was a <422: Unprocessable Entity>.
Expected: 200
Actual: 422
Response body: {"errors":["Invalid settings object for section '1'"]}
```
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
|
| |
Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005
* Forward compat with new unified Integer class in Ruby 2.4+.
* Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3.
* Drops needless Fixnum distinction in docs, preferring Integer.
|
|
|
|
|
| |
Also, refactor logic to convert between symbol and response code,
via the AssertionResponse class
|
|
|
|
|
|
|
| |
The ActionPack test suite had a handful of these warnings when run. This
was due to `assert_response` being tested outside the context of a
controller instance where those instance variables would already have
been initialized.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
renamed to `Minitest`
Ref: https://github.com/seattlerb/minitest/blob/master/History.txt
|
|
|
|
|
| |
This commit makes it really easy to debug errors due to typos like
"assert_response :succezz".
|
|
|