[Fix] issue in notifications

With and without my changes, I locally I got 8 errors in the attachment_controller_test.rb. Which I did not change. But Travis says everything is ok so it seems to be ok. 

Fixes https://www.openproject.org/work_packages/3980