Rails port of testing environment

后端 未结 2 335
再見小時候
再見小時候 2021-01-18 17:49

I\'d like to test the HTTP API of our Rails app using Faraday and RSpec. Faraday needs the host url + port. Unfortunately the port of the testing environment does always cha

2条回答
  •  天涯浪人
    2021-01-18 18:38

    If using Capybara you can set the port in the spec_helper.rb like so:

    Capybara.server_port = 1234
    

    See also: https://github.com/jnicklas/capybara/pull/123

提交回复
热议问题