Skip to content

Commit

Permalink
Spec now is testing same ems_ref new uid_ems
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Apr 2, 2019
1 parent c50628b commit f975f5e
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions spec/models/ems_refresh/save_inventory_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,24 +128,15 @@
EmsRefresh.save_vms_inventory(@ems, data)

vms = Vm.all
expect(vms.length).to eq(3)

disconnected, connected = vms.partition { |v| v.ems_id.nil? }
expect(disconnected.length).to eq(1)
expect(connected.length).to eq(2)

d = disconnected.first
c1, c2 = connected.sort_by(&:id)
expect(vms.length).to eq(2)

expect(d.id).to eq(@vm2.id)
expect(d.uid_ems).to eq(@vm2.uid_ems)
vm1, vm2 = vms.sort_by(&:id)

expect(c1.id).to eq(@vm1.id)
expect(c1.uid_ems).to eq(@vm1.uid_ems)
expect(vm1.id).to eq(@vm1.id)
expect(vm1.uid_ems).to eq(@vm1.uid_ems)

expect(c2.id).not_to eq(@vm1.id)
expect(c2.id).not_to eq(@vm2.id)
expect(c2.uid_ems).to eq(@vm1.uid_ems)
expect(vm2.id).to eq(@vm2.id)
expect(vm2.uid_ems).to eq(@vm1.uid_ems)
end
end

Expand Down

0 comments on commit f975f5e

Please sign in to comment.