this doesn't actually test that the query works though. the archived_post will only be created if you reference it somewhere in your test, so in the example you gave, the test will pass whether or not active_posts limits by archived or not. I made a few changes based on what you said - take a look.