FactoryBot.define do
  factory :scheduled_task do
    association :schedulable, factory: :page
    time { Time.now + 5.minutes }

    factory :pending_task do
      status { :pending }

      factory :executable_task do
        time { Time.now - 2.minutes }
      end
    end

    factory :failed_task do
      status { :failed }
    end

    factory :successful_task do
      status { :successful }
    end

  end
end
