cucumber-api-steps icon indicating copy to clipboard operation
cucumber-api-steps copied to clipboard

host required

Open chikamichi opened this issue 11 years ago • 2 comments

Hi,

In a Rails app using Capybara, in order to use the "I send a XXX request to…" step definitions, I needed to specify the host otherwise it would always 404. Therefore I now provide page.driver.send with a fully-fledged path in the step definition. I did that the brutal way by adding the following piece of code in the step definition, before the final if/else:

current_host = Capybara.app_host || Capybara.default_host
path = current_host + path

Capybara's internals (see Capybara::RackTest::Browser#process) feature a more subtle way of handling the issue.

Still, I am not sure how it should be fixed in cucumber-api-steps. Food for thoughts!

chikamichi avatar Dec 13 '12 07:12 chikamichi

Hmm, I've not run into this one. What versions of Rails and Capybara are you on?

jayzes avatar Dec 13 '12 15:12 jayzes

Rails 3.2.9 and Capybara 2.0.1

chikamichi avatar Dec 13 '12 16:12 chikamichi