Re: Mocking request.remote_ip for testing.

tinney
Mon, 24 Sep 2007 15:33:20 -0000

Have you looked at passing in request parameters to the get method?

get(url, {},
{''REMOTE_ADDR''=>''123.1.1.1''})

On Sep 17, 3:03 pm, Clem Rock
<rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:
> Hello,
>
>     I''m writing test for some geo-location methods which are all
very IP
> dependent.
>
> Is there a good way to mock a request.remote_ip?
>
> Thanks for any help,
>
> Clem C
> --
> Posted viahttp://www.ruby-forum.com/.