Project

General

Profile

Actions

Refactor #18199

closed

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

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

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: ""
Actions

Also available in: Atom PDF