Skip to content

Commit

Permalink
Improve entitlement creation
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Nov 4, 2024
1 parent e4269ae commit cf93f23
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions spec/models/miq_request_workflow_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit cf93f23

Please sign in to comment.