diff options
author | Prathamesh Sonpatki <csonpatki@gmail.com> | 2015-12-06 21:39:59 +0530 |
---|---|---|
committer | Prathamesh Sonpatki <csonpatki@gmail.com> | 2015-12-06 21:39:59 +0530 |
commit | b24711621075350285fed67392720349722f4654 (patch) | |
tree | c75bd3c36867355d598b343b245dbc4e08967d11 /railties | |
parent | 65443ceb0d55e1445b28e31e772629424e6755c3 (diff) | |
download | rails-b24711621075350285fed67392720349722f4654.tar.gz rails-b24711621075350285fed67392720349722f4654.tar.bz2 rails-b24711621075350285fed67392720349722f4654.zip |
Use assert over assert_predicate in assert_response
- `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>
Diffstat (limited to 'railties')
0 files changed, 0 insertions, 0 deletions