cleaned up regex expressions to be more readable and removed some active record dependencies in spec_helper