Can we assert the result instead of the SQL? The SQL generation can change in the future and this test will broke.