Refactor action tests