Actions
Refactor #18976
closedHostsControllerTest REMOTE_USER tests should not assume format of subsequent requests
Description
Under Rails 5.0, two HostsControllerTest tests fails:
HostsControllerTest#test_0037_if only authorize_login_delegation is set, REMOTE_USER should be
ignored for API requests [test/controllers/hosts_controller_test.rb:617]:
Expected response to be a <2XX: success>, but was a <401: Unauthorized>
When making a JSON format request followed by a request with no explicit format, Rails 5 is now memorising that it's requesting application/json instead of resetting to HTML or similar.
This is not a bug in Rails 5, as it shouldn't be assumed that the state will be reset between requests in a single test case: https://github.com/rails/rails/commit/33db42168425866b714203e35a3a36693983b3f9
The format should be set explicitly or moved into separate tests with a common setup.
Actions