Moves the view mocking logic into a helper.