I would like to test the json responses of a rails application using rspec in combination with faraday and faraday_middleware. To use faraday one needs the application URL. In the tests I would like to use localhost + a port number.
The question is, how can I get or set the port number of the current application instance in a rspec test environment?
There are a similar questions but no satisfying answers here and here.