adding conditional query for ActiveRecord test