Sha256: 3c182b492103bb7646921987aeb8d5bc4f2e17059e92c62f32e5e62498ab223c
Contents?: true
Size: 1.15 KB
Versions: 3
Compression:
Stored size: 1.15 KB
Contents
FactoryGirl.define do factory :some_task, :class => ForemanTasks::Task do sequence(:label) { |n| "task#{n}" } type 'ForemanTasks::Task' state 'stopped' result 'success' transient do set_owner nil end after(:create) do |task, evaluator| ForemanTasks::Lock.owner!(evaluator.set_owner, task.id) if evaluator.set_owner end factory :dynflow_task, :class => ForemanTasks::Task::DynflowTask do label "Support::DummyDynflowAction" type "ForemanTasks::Task::DynflowTask" started_at "2014-10-01 11:15:55" ended_at "2014-10-01 11:15:57" state "stopped" result "success" parent_task_id nil after(:build) do |task| dynflow_task = ForemanTasks.dynflow.world.plan(Support::DummyDynflowAction) # remove the task created automatically by the persistence ForemanTasks::Task.where(:external_id => dynflow_task.id).delete_all task.external_id = dynflow_task.id end trait :user_create_task do label "Actions::User::Create" end trait :product_create_task do label "Actions::Katello::Product::Create" end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
foreman-tasks-0.6.13 | test/factories/task_factory.rb |
foreman-tasks-0.6.12 | test/factories/task_factory.rb |
foreman-tasks-0.6.11 | test/factories/task_factory.rb |