2c0108190c
This is because creating a procedure attempts to create an admin from
scratch, and fails to do so.
Broken by 802f2086d6
19 lines
463 B
Ruby
19 lines
463 B
Ruby
FactoryBot.define do
|
|
sequence(:administrateur_email) { |n| "admin#{n}@admin.com" }
|
|
factory :administrateur do
|
|
email { generate(:administrateur_email) }
|
|
password { 'mon chien aime les bananes' }
|
|
end
|
|
|
|
trait :with_api_token do
|
|
after(:create) do |admin|
|
|
admin.renew_api_token
|
|
end
|
|
end
|
|
|
|
trait :with_procedure do
|
|
after(:create) do |admin|
|
|
admin.procedures << create(:simple_procedure, administrateur: admin)
|
|
end
|
|
end
|
|
end
|