In the process of testing some custom error handling I found myself needing to fake my remote address when visiting pages with Capybara and Rack::Test.
To do this I had to delve in to the internals of Rack::Test using the following Cucumber step.
1 2 3 4 5 | |
The reason this is necessary is that Rack::Test does not expose
the REMOTE_ADDR header, instead always setting the value to 127.0.0.1.