I have an app that is built on top of Vue.js and Rails.
When a button is clicked, it will fire an API call (eg. POST api.example.com/create
) to the Rails backend.
NOTE: The frontend (eg. blog.example.com
) and backend (eg. api.example.com
) have different subdomains
I would like to test the flow using Capybara but whenever I simulate the click on the button, it will return net::ERR_CONNECTION_REFUSED
error on the frontend.
My assumption is I need to configure my Capybara to adapt to this setup but I can't figure out what am I missing here.
I have tried to set
config.server_host = 'http://api.example.com'
OR
config.app_host = 'http://api.example.com'
but both didn't work for me.