I have a Company model that has an after_create callback that creates default roles, users, etc for the new company. In the development environment, this all works great. In my company unit test however, an ActiveRecord::RecordNotSaved is thrown on the first attempt to create a role for the new company (and this is also the first attempt to create anything in the after_create callback). I have added logger statements in the code to verify that both the company and new role are valid, and they are. Is there something I am missing? If not, is there a better way to track down why I am getting a RecordNotSaved?
TIA, -Bill