Project

General

Profile

« Previous | Next » 

Revision adb9247c

Added by Daniel Lobato Garcia about 9 years ago

Refs #9500 - revert normalize_name tests

Current test "#normalize_hostname sets a domain based on name that contains its name if it's nil and such domain exists" is not testing anything because Domain.all does not return any domains to match (as .create was substituted on merge by .build).
(cherry picked from commit 6ee8b1c279468601dc2399448f70244f24f58d37)

View differences:

test/unit/nics/managed_test.rb
end
test "#normalize_hostname keeps domain nil if it can't find such domain based on name" do
domain = FactoryGirl.build(:domain)
domain = FactoryGirl.create(:domain)
nic = setup_primary_nic_with_name(" Host.#{domain.name}.custom", :domain => nil)
nic.send(:normalize_name)
assert_equal "host.#{domain.name}.custom", nic.name
......
end
test "#normalize_hostname does not touch name if it's different from domain name and it's a new record (leaves inconsistency)" do
domain = FactoryGirl.build(:domain)
domain = FactoryGirl.create(:domain)
nic = setup_primary_nic_with_name(" Host.#{domain.name}.custom", :domain => domain)
nic.send(:normalize_name)
assert_equal "host.#{domain.name}.custom", nic.name

Also available in: Unified diff