refactoring attachments controller
spork for faster tests