aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/assertions
Commit message (Collapse)AuthorAgeFilesLines
* Fix "instance variable not initialized" in testsDerek Prior2015-12-171-0/+5
| | | | | | | 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.
* Show redirect response code in assert_response messagesJon Atack2015-12-111-7/+28
| | | | | | | | | | | | 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.
* Use assert over assert_predicate in assert_responsePrathamesh Sonpatki2015-12-061-2/+2
| | | | | | | | | | | | | | | | | | | - `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>
* Add redirection path in the error message of assert_response if response is ↵Prathamesh Sonpatki2015-12-041-1/+16
| | | | | | | | | | | | | | | | :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>
* use a lookup table for `assert_response`Aaron Patterson2015-07-131-2/+2
| | | | | | | | 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
* Change all `MiniTest` to `Minitest` since, `MiniTest` namespace has been ↵Vipul A M2013-12-181-5/+5
| | | | | | renamed to `Minitest` Ref: https://github.com/seattlerb/minitest/blob/master/History.txt
* Better error message for typos in assert_response argument.Victor Costan2013-11-251-0/+8
| | | | | This commit makes it really easy to debug errors due to typos like "assert_response :succezz".
* test response assertionsAaron Patterson2012-01-061-0/+55