I can manually test my API via rails s and point my HTTP client to http://127.0.0.1:3000/api.
Now, I want to automatically test my API via features. So I successfully set up a guard server which starts cucumber and rspec.
Does cucumber start my application and provide my API entry point under any port? So that I can use a HTTP client inside my step definitions and point it to http://127.0.0.1:8989/api for example?
I know that I can specify a :cucumber_port => 4321 in the Guardfile but my API is not available under this port.
No, Cucumber doesn’t start your application with server.
To test it you can do the following:
#get,#post, etc. It’s preferred. For example:env.rb:Now you can access your API at
http://127.0.0.1:9887/api