Improve factories
This commit is contained in:
parent
6ac24de25f
commit
5939e3ec87
1 changed files with 5 additions and 3 deletions
|
@ -1,9 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
FactoryBot.define do
|
||||
factory :passport_without_image, class: Passport do
|
||||
confirmed { false }
|
||||
|
||||
factory :empty_passport, class: Passport do
|
||||
surname { Faker::Name.last_name }
|
||||
given_name { Faker::Name.first_name }
|
||||
patronymic { Faker::Name.first_name }
|
||||
|
@ -19,6 +17,10 @@ FactoryBot.define do
|
|||
date_of_issue { Faker::Date.backward }
|
||||
end
|
||||
|
||||
factory :passport_without_image, parent: :empty_passport do
|
||||
confirmed { false }
|
||||
end
|
||||
|
||||
factory :passport_with_image, parent: :passport_without_image do
|
||||
transient do
|
||||
image_filename { image_fixture }
|
||||
|
|
Reference in a new issue