# frozen_string_literal: true FactoryBot.define do factory :site do name { "test-#{SecureRandom.hex}" } title { SecureRandom.hex } description { SecureRandom.hex * 2 } design licencia after :build do |site| # XXX: Generamos un DeployLocal normalmente y no a través de una # Factory porque necesitamos que el sitio se genere solo. # # @see {https://github.com/thoughtbot/factory_bot/wiki/How-factory_bot-interacts-with-ActiveRecord} site.canonical_deploy = site.deploys.build(type: 'DeployLocal') end end end