user1066183
user1066183

Reputation: 2584

Capybara set host and port using non-rails application

I am using Capybara with a non-rails custom rack application. accordingly with official doc I have set:

Capybara.app = MyRackApp

I have a test that visit a login page. If I print:

p current_url

while running my test I see:

"http://www.example.com/login"

So, the question is: using a rack application Capybara does set automatically the host and the port?

Upvotes: 0

Views: 205

Answers (1)

Thomas Walpole
Thomas Walpole

Reputation: 49880

There is no host and port set when using the default rack_test driver because it doesn't fire up a server thread to run the app, it directly communicates with the rack app. If you use the selenium driver (or capybara-webkit, poltergeist, etc) then a port would be set and a server thread would be started.

Upvotes: 1

Related Questions