Active record issues while testing