zmcartor/lordinateuramuse — comment on commit b47e0c8685b92326672024487819f05db0a07c42
File: spec/app_spec.rb line 44
By mattyoho:

The intent here seems to be verifying the existence of the recommended post. As is, you could also simply say `test_post.should be` and the RSpec matcher will verify non-nilness. Similarly, `test_post.should_not be_nil`. However, `Post.all` most likely returns an array, which could in fact be empty. An empty array is not nil, however, so this test could potentially pass even if no `Post` objects are returned. An additional check, `test_post.should_not be_empty` might be called for. Alternatively, ensure test_post is actually a single instance of `Post` and verify, say, the `url` attribute of that post is as expected.