Got all tests pass, a little confused about the tests involving sql

Confused about the tests involving sql. Is this the right thought process? 
So for the "have many author" and "be searchable by name" tests, where we are searching the database using active record, the test is using ActiveRecord and we are returning what the sql would be to make that same command?