test/factories/task_factory.rb in foreman-tasks-0.6.13 vs test/factories/task_factory.rb in foreman-tasks-0.6.14
- old
+ new
@@ -21,21 +21,27 @@
state "stopped"
result "success"
parent_task_id nil
after(:build) do |task|
- dynflow_task = ForemanTasks.dynflow.world.plan(Support::DummyDynflowAction)
+ execution_plan = 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
+ ForemanTasks::Task.where(:external_id => execution_plan.id).delete_all
+ task.update_from_dynflow(execution_plan.to_hash)
end
trait :user_create_task do
label "Actions::User::Create"
end
trait :product_create_task do
label "Actions::Katello::Product::Create"
+ end
+
+ trait :inconsistent_dynflow_task do
+ after(:build) do |task|
+ task.update_attributes!(:state => 'running')
+ end
end
end
end
end