Project

General

Profile

Refactor #18199

HostgroupsControllerTest empty parameter values test should pass "", not nil in request

Added by Dominic Cleal over 4 years ago. Updated about 3 years ago.

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

Description

The test "HostgroupsControllerTest::parent attributes#test_0003_updates a hostgroup with a parent parameter, allows empty values" passes an empty parameter field in the request using nil, but for a UI form-encoded request it should be "" (empty string). The UI will not generate (and cannot pass) a nil value.

This fails under Rails 5.0.1 where the test request is form encoded and nil is converted to an empty string rather than being passed as nil on Rails 4.2. The assertion checking that the parameter is set to nil then fails.

HostgroupsControllerTest::parent attributes#test_0003_updates a hostgroup with a parent parameter, allows empty values [test/controllers/hostgroups_controller_test.rb:210]:
Expected: nil
Actual: ""

Associated revisions

Revision d6ebd69f (diff)
Added by Dominic Cleal over 4 years ago

fixes #18199 - empty parameter value is an empty string, not nil

History

#1 Updated by The Foreman Bot over 4 years ago

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

#2 Updated by Dominic Cleal over 4 years ago

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

#3 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 209

Also available in: Atom PDF