Make some exec_query expectations less fragile between rails versions.

These expectations were failing on rails 4.2.0.rc1
test: Refactor a repeated query expectation into a helper method.
Merge pull request #186 from Shopify/less-fragile-exec-query-expects

Make some exec_query expectations less fragile between rails versions.