Skip to content

Commit

Permalink
Merge pull request #18692 from djberg96/address_validation_spec_fixes
Browse files Browse the repository at this point in the history
[HAMMER] [V2V] ConversionHost address validation spec fixes
  • Loading branch information
simaishi authored Apr 26, 2019
2 parents 716845c + 2648342 commit b79170f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion spec/models/conversion_host_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand All @@ -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

0 comments on commit b79170f

Please sign in to comment.