I am using Cucumber and Capybara to perform some acceptance tests.
To my understanding, capybara should follow redirects, and as I see, it does... usually.
Recently we have made some changes in the infrastructure. This change creates a 308 redirect code, instead of the previously generated 301. With this 308 code, it seems like capybara no longer follows it.
When running my test, I can clearly see that it didn't:
expected to find text "Welcome" in "308 Permanent Redirect nginx/1.13.8" (RSpec::Expectations::ExpectationNotMetError)
I should mention that in the past (with the 301 redirect) the exact same test worked.
Is this a capybara bug? If not, what am I missing?
This isn't capybara
not following 308s, it's that the driver you're using with capybara
isn't following 308s. That driver is capybara-webkit
and depending on what version of QtWebkit you built it against is roughly equivalent to a 5-9 year old browser which doesn't really support a lot of things modern browsers do. You're going to have a lot fewer issues around browser support if you swap to using selenium with headless chrome as your driver for at least some of your tests (those that require newer browser features)