Fixes posts controller (missing part of code?)

You can make all tests passes without this line of code, however you will never get your app working in development env. Why? 
Factories in tests include user mocking. In dev env all posts will have empty user_id.
I'm not sure was it intended to be task part so created this PR.