1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/test/assertions
Kir Shatrov bc3b0e7292 Improve assert_response helper
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'"]}
```
2016-09-14 11:30:09 -04:00
..
response_assertions_test.rb Improve assert_response helper 2016-09-14 11:30:09 -04:00