Make some exec_query expectations less fragile between rails versions.

@fbogsany for review

These expectations were failing on rails 4.2.0.rc1 because exec_query took a third parameter and one of the two spaces preceding `WHERE` was removed in the SQL query strings.
Sure, I could create a method that could be used like this

```ruby
expect_fetch_associated_record_name_by_id('foo')
```

The sad thing is that I can't just use `.select(:name)` to get the same SQL, since it won't quote the name on all the rails versions we support.