You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Capybara::RackTest::Browser#refresh will use the same request environment hash contents as were used when requesting the current page.
Actual Behavior
Capybara::RackTest::Browser#refresh uses the same request environment object as was used when requesting the current page, which means if the rack application made changes to the environment object during page processing, those changes will included in the refresh request, when they should not be.
Fixing this probably means making a copy of the environment hash before submitting the request, and using that copy for refreshes. That's going to slow down all usage with rack-test, even when #refresh is not used, but I think it's necessary for correct behavior. A shallow copy may be sufficient to handle most cases. There might be pathological cases that require a deep copy, though.
The text was updated successfully, but these errors were encountered:
Meta
Capybara Version:
3.39.1
Driver Information (and browser if relevant):
rack-test
Expected Behavior
Capybara::RackTest::Browser#refresh will use the same request environment hash contents as were used when requesting the current page.
Actual Behavior
Capybara::RackTest::Browser#refresh uses the same request environment object as was used when requesting the current page, which means if the rack application made changes to the environment object during page processing, those changes will included in the refresh request, when they should not be.
Steps to reproduce
Fixing this probably means making a copy of the environment hash before submitting the request, and using that copy for refreshes. That's going to slow down all usage with rack-test, even when #refresh is not used, but I think it's necessary for correct behavior. A shallow copy may be sufficient to handle most cases. There might be pathological cases that require a deep copy, though.
The text was updated successfully, but these errors were encountered: