Finish repository specs. Improve controller specs