ruby on rails - How to test OPTIONS request with Capybara? -
what way test options response capybara?
use case: need configure rails app response headers cors. know not part of "user experience". however, if browser cannot make request, user not going able use site.
a way test options response capybara not using capybara.
jokes aside, better done in controller test since not involve actual html parsing.
rspec.describe rabbitscontroller describe "get :show" "enables cors" :index expect(response.headers['access-control-allow-origin']).to eq "*" end end end
you can test options http method process :show, "options"
[1]
Comments
Post a Comment