[rspec-users] Spec'ing Rails request.env params

Mikel Lindsaar raasdnil at gmail.com
Thu Feb 14 21:45:31 EST 2008


I have an internal system that has a rails controller action that
needs to behave differently based on browser type reported by
request.env['HTTP_USER_AGENT']

But I can't find a way to stub! mock or set this setting from within a spec.

Looked through Test::Unit and can't find a straight forward way in there either.

Anyone had any luck with this?

Mikel


More information about the rspec-users mailing list