Stub HTTP_USER_AGENT in RSpec for Rails


  request.stub!(:user_agent).and_return('Mozilla')