Project

General

Profile

Actions

Refactor #18199

closed

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

Added by Dominic Cleal about 7 years ago. Updated almost 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 #1

Updated by The Foreman Bot about 7 years ago

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

Updated by Dominic Cleal about 7 years ago

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

Updated by Dominic Cleal about 7 years ago

  • translation missing: en.field_release set to 209
Actions

Also available in: Atom PDF