From 7ba3c0d0df1818b43bce5b4a01ecb4a25f76227b Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Mon, 4 Nov 2024 08:52:29 -0500 Subject: [PATCH] Improve entitlement creation --- spec/models/miq_request_workflow_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/models/miq_request_workflow_spec.rb b/spec/models/miq_request_workflow_spec.rb index 2c6f6049e8b..cedb3dbb52c 100644 --- a/spec/models/miq_request_workflow_spec.rb +++ b/spec/models/miq_request_workflow_spec.rb @@ -354,11 +354,12 @@ let(:datacenter) { FactoryBot.create(:vmware_datacenter, :ems_id => ems.id).tap { |d| d.add_parent(root_folder) } } let(:storage) { FactoryBot.create(:storage, :ems_id => ems.id).tap { |s| s.add_parent(datacenter) } } + let(:entitlement_filters) { {"managed" => [], "belongsto" => belongsto_filter} } + let(:entitlement) { FactoryBot.create(:entitlement, :filters => entitlement_filters) } + before do group = workflow.requester.miq_groups.first - group.entitlement = Entitlement.new - group.entitlement.set_managed_filters([]) - group.entitlement.set_belongsto_filters(belongsto_filter) + group.entitlement = entitlement group.save! end