Abstracted logic for controller unit tests to abstract controller spec.