Revision 86ac65a9
Added by Stephen Benjamin almost 6 years ago
test/models/host_test.rb | ||
---|---|---|
@host = FactoryBot.create(:host, :managed => false)
|
||
@location = Location.create :name => "New York"
|
||
@organization = Organization.create :name => "Hosting client 1"
|
||
|
||
@organization.locations << @location
|
||
end
|
||
|
||
test "assign a host to a location" do
|
||
... | ... | |
@host.organization_id = @organization.id
|
||
|
||
assert @host.save!
|
||
assert @host.organization.valid?
|
||
assert @host.location.valid?
|
||
end
|
||
end
|
||
|
Also available in: Unified diff
fixes #23178 - seeded location should be in seeded org
When creating a host in the seeded org and seeded loc, host saves and
then organization becomes invalid: "Locations expecting locations used
by hosts or inherited (check mismatches report)."