One of my models' default scope is set to automatically load a related model with includes()
. How can I test this functionality with RSpec? I tried running:
Model.includes(:relation).to_sql
Hoping I could detect the signature in the SQL, but it only returned this:
SELECT "models".* FROM "models"
No mention of the relation, it's apparently done with a second query. How would you recommend testin this?