Skip to content

Commit

Permalink
Merge pull request ManageIQ#16939 from tumido/miq_requests_scopes
Browse files Browse the repository at this point in the history
Add MiqRequest factory with MiqApproval
  • Loading branch information
bdunne authored Feb 19, 2018
2 parents 38ede59 + c52b959 commit fb9e78a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/factories/miq_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,15 @@
factory :miq_provision_request, :class => "MiqProvisionRequest" do
source { create(:miq_template) }
end

trait :with_approval do
transient do
reason ""
end

after(:create) do |request, evaluator|
request.miq_approvals << FactoryGirl.create(:miq_approval, :reason => evaluator.reason)
end
end
end
end

0 comments on commit fb9e78a

Please sign in to comment.