diff --git a/spec/models/miq_request_workflow_spec.rb b/spec/models/miq_request_workflow_spec.rb index 2c6f6049e8b..379f83549a6 100644 --- a/spec/models/miq_request_workflow_spec.rb +++ b/spec/models/miq_request_workflow_spec.rb @@ -353,12 +353,14 @@ let(:root_folder) { FactoryBot.create(:ems_folder, :ems_id => ems.id).tap { |f| f.add_parent(ems) } } 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(:group) { workflow.requester.miq_groups.first } + + 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