Unit tests for r2 controller