Actions
Bug #18540
closedHost#update_attribute(domain: ...) tests fail on Rails 5, model not saved
Description
Tests that update a host's domain via update_attribute fail on Rails 5, e.g.
Failure: DomainTest#test_0011_should update hosts_count on domain_id change [/home/dcleal/code/foreman/foreman/test/models/domain_test.rb:118]: "@domain.hosts_count" didn't change by -1. Expected: 0 Actual: 1
The attribute isn't actually on Host::Managed, but the primary Nic via a delegation of #domain= to the primary_interface. Rails 5 has an optimisation in update_attribute that skips the #save when the model's not changed (https://github.com/rails/rails/commit/0fcd4cf) so the change doesn't trigger a save.
The tests should either call #domain= and #save themselves instead of using #update_attribute for this non-attribute, or change the domain attribute on the interface.
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/4296 added
Updated by Dominic Cleal almost 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset a61ecf633c173611f7f409a3017aeb92f939550a.
Updated by Dominic Cleal almost 8 years ago
- Translation missing: en.field_release set to 209
Actions