refactor test for update action in post controller