I have a Rails controller which behaves differently based on the IP address of the remote request. However, the defaults for functional tests get submitted with an IP of 0.0.0.0. How can I create a series of tests that use various remote IP addresses per get? Thanks, Chaz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/10/07, Chaz <chazzy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > I have a Rails controller which behaves differently based on the IP > address of the remote request. However, the defaults for functional > tests get submitted with an IP of 0.0.0.0. How can I create a series of > tests that use various remote IP addresses per get? >@request.env[''REMOTE_ADDR''] = ''10.0.1.1'' # or whatever IP address Do that in your setup before your test. Might be a more direct way, but that''s how I''ve been doing it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, Jim -- that''s exactly what I needed. Chaz On 1/10/07, Jim Lindley <jimlindley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 1/10/07, Chaz <chazzy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I have a Rails controller which behaves differently based on the IP > > address of the remote request. However, the defaults for functional > > tests get submitted with an IP of 0.0.0.0. How can I create a series of > > tests that use various remote IP addresses per get? > > > > @request.env[''REMOTE_ADDR''] = ''10.0.1.1'' # or whatever IP address > > Do that in your setup before your test. Might be a more direct way, > but that''s how I''ve been doing it. > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---