Skip to content

Commit

Permalink
Add MiqRequest factory with MiqApproval
Browse files Browse the repository at this point in the history
  • Loading branch information
tumido committed Feb 19, 2018
1 parent 38ede59 commit c52b959
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 c52b959

Please sign in to comment.