|
56 | 56 | end |
57 | 57 |
|
58 | 58 | context "with attrs template => true, ems_id => nil, host_id => nil" do |
59 | | - let(:attrs) { {:template => true, :ems_id => nil, :host_id => nil} } |
| 59 | + subject { FactoryBot.create(:miq_template, attrs) } |
| 60 | + let(:attrs) { {:ems_id => nil, :host_id => nil} } |
60 | 61 |
|
61 | 62 | it("is not #registered?") { expect(subject.registered?).to be false } |
62 | 63 | it("is not in registered_vms") { expect(registered_vms).to_not include subject } |
63 | 64 | it("is in unregistered_vms") { expect(unregistered_vms).to include subject } |
64 | 65 | end |
65 | 66 |
|
66 | 67 | context "with attrs if template => true, ems_id => nil, host_id => [ID]" do |
67 | | - let(:attrs) { {:template => true, :ems_id => nil, :host_id => host.id} } |
| 68 | + subject { FactoryBot.create(:miq_template, attrs) } |
| 69 | + let(:attrs) { {:ems_id => nil, :host_id => host.id} } |
68 | 70 |
|
69 | 71 | it("is not #registered?") { expect(subject.registered?).to be false } |
70 | 72 | it("is not in registered_vms") { expect(registered_vms).to_not include subject } |
71 | 73 | it("is in unregistered_vms") { expect(unregistered_vms).to include subject } |
72 | 74 | end |
73 | 75 |
|
74 | 76 | context "with attrs if template => true, ems_id => [ID], host_id => nil" do |
75 | | - let(:attrs) { {:template => true, :ems_id => ems.id, :host_id => nil} } |
| 77 | + subject { FactoryBot.create(:miq_template, attrs) } |
| 78 | + let(:attrs) { {:ems_id => ems.id, :host_id => nil} } |
76 | 79 |
|
77 | 80 | it("is not #registered?") { expect(subject.registered?).to be false } |
78 | 81 | it("is not in registered_vms") { expect(registered_vms).to_not include subject } |
79 | 82 | it("is in unregistered_vms") { expect(unregistered_vms).to include subject } |
80 | 83 | end |
81 | 84 |
|
82 | 85 | context "with attrs if template => true, ems_id => [ID], host_id => [ID]" do |
83 | | - let(:attrs) { {:template => true, :ems_id => ems.id, :host_id => host.id} } |
| 86 | + subject { FactoryBot.create(:miq_template, attrs) } |
| 87 | + let(:attrs) { {:ems_id => ems.id, :host_id => host.id} } |
84 | 88 |
|
85 | 89 | it("is #registered?") { expect(subject.registered?).to be true } |
86 | 90 | it("is in registered_vms") { expect(registered_vms).to include subject } |
|
0 commit comments