5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-07-01 12:56:07 +00:00
panel/test/factories/site.rb

20 lines
573 B
Ruby

# 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