Project

General

Profile

Actions

Refactor #18976

closed

HostsControllerTest REMOTE_USER tests should not assume format of subsequent requests

Added by Dominic Cleal almost 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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 #1

Updated by The Foreman Bot almost 8 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/4395 added
Actions #2

Updated by Dominic Cleal almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #3

Updated by Ohad Levy over 7 years ago

  • Translation missing: en.field_release set to 209
Actions

Also available in: Atom PDF