works correctly with simulated params hash passed in