I need to download a csv file from my app using Open::URI and to do that I need to give it a fully qualified URI. So whats the best way to get the HOST and more importantly PORT in my cucumber script?
Note I am using Capybara and Selenium
original title: "ruby on rails - Cucumber / Capybara -- how to get the host and port of the current execution"
I need to download a csv file from my app using Open::URI and to do that I need to give it a fully qualified URI. So whats the best way to get the HOST and more importantly PORT in my cucumber script?
Note I am using Capybara and Selenium
Open :: URIを使用してアプリからcsvファイルをダウンロードする必要があります。これを行うには、完全修飾URIを指定する必要があります。それで、ホスト、そしてより重要なPOを取得するための最良の方法は...
これは翻訳後の要約です。完全な翻訳を表示する必要がある場合は、「翻訳」アイコンをクリックしてください。
You can set port that will be used to spawn an application server
For capybara < 2.0:
Capybara 2.0:
FYI, my use case is having clickable links in the mail generated by the integration tests.
You can use current_host but I don't know if it contains the port. Alternatively you can use current_url and strip the path (and possibly the query string).