3 ms·
> IMO there's no point in checking that you got a response in 1 test, and then checking the content/result of that response in another test. The useful portion
by iLoveOncall 4y ago
> IMO there's no point in checking that you got a response in 1 test, and then checking the content/result of that response in another test. The useful portion of that test is the response bit.
If I understood this part correctly, you are making the dangerous assumption that your tests will run in a particular order.
- daviddever23box 4y ago...which is why it may be worthwhile to chain some assertions together in a single test.
- wccrawford 4y agoNo, I definitely am not making that assumption. With a bad response, but a good response code, 1 test would fail and the other would succeed, no matter the order. I just don't think that that valid response code is a useful test on its own. It's much better with both assertions in the same test, unless you have some reason to think that response code failure would signify something special on its own.