User Agent Testing in Rack/Test
When using Rack::Test, to mock out the user-agent of the request, do something like:
get "/activate/", {}, {'HTTP_USER_AGENT' => "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Mobile/11A501 Twitter for iPhone"}