From 26483421fa90c15982c14f362ff91c1b8afe8af9 Mon Sep 17 00:00:00 2001 From: Daniel Berger Date: Fri, 26 Apr 2019 09:09:18 -0400 Subject: [PATCH] Fix ConversionHost address validation specs for Hammer. --- spec/models/conversion_host_spec.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/models/conversion_host_spec.rb b/spec/models/conversion_host_spec.rb index d1580cce2a3..ec3590f0349 100644 --- a/spec/models/conversion_host_spec.rb +++ b/spec/models/conversion_host_spec.rb @@ -439,7 +439,7 @@ end context "address validation" do - let(:vm) { FactoryBot.create(:host) } + let(:vm) { FactoryBot.create(:vm_openstack) } it "is invalid if the address is not a valid IP address" do allow(vm).to receive(:ipaddresses).and_return(['127.0.0.1']) @@ -465,5 +465,11 @@ conversion_host = ConversionHost.new(:name => "test", :resource => vm, :address => "127.0.0.2") expect(conversion_host.valid?).to be(true) end + + it "is valid if an address is not provided" do + allow(vm).to receive(:ipaddresses).and_return(['127.0.0.1']) + conversion_host = ConversionHost.new(:name => "test", :resource => vm) + expect(conversion_host.valid?).to be(true) + end end end