spec: fix specs failing randomly

This is because creating a procedure attempts to create an admin from
scratch, and fails to do so.

Broken by 802f2086d6
This commit is contained in:
Pierre de La Morinerie 2019-01-03 17:42:43 +01:00
parent 053083390d
commit 2c0108190c
4 changed files with 9 additions and 5 deletions

View file

@ -10,4 +10,10 @@ FactoryBot.define do
admin.renew_api_token
end
end
trait :with_procedure do
after(:create) do |admin|
admin.procedures << create(:simple_procedure, administrateur: admin)
end
end
end