It seems like the failure is related to the fact that post is not persisted and you're using it in the query, rather than a problem with polymorphic relationships. If you try this with a non-polymorphic relationship, I think you'll have the same result.

If you persist the post, the test passes. Is that what you were expecting?